From d832c9780acdae39cb2c3e75b079514532c64542 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Mon, 5 Jul 2021 16:51:26 +1000 Subject: [PATCH] Implement undo for qto operators. See #1475. --- src/blenderbim/blenderbim/bim/module/qto/operator.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/blenderbim/blenderbim/bim/module/qto/operator.py b/src/blenderbim/blenderbim/bim/module/qto/operator.py index b52a89cae4..02d1f32916 100644 --- a/src/blenderbim/blenderbim/bim/module/qto/operator.py +++ b/src/blenderbim/blenderbim/bim/module/qto/operator.py @@ -10,6 +10,7 @@ from ifcopenshell.api.pset.data import Data as PsetData class CalculateEdgeLengths(bpy.types.Operator): bl_idname = "bim.calculate_edge_lengths" bl_label = "Calculate Edge Lengths" + bl_options = {"REGISTER", "UNDO"} def execute(self, context): result = 0 @@ -26,6 +27,7 @@ class CalculateEdgeLengths(bpy.types.Operator): class CalculateFaceAreas(bpy.types.Operator): bl_idname = "bim.calculate_face_areas" bl_label = "Calculate Face Areas" + bl_options = {"REGISTER", "UNDO"} def execute(self, context): result = 0 @@ -42,6 +44,7 @@ class CalculateFaceAreas(bpy.types.Operator): class CalculateObjectVolumes(bpy.types.Operator): bl_idname = "bim.calculate_object_volumes" bl_label = "Calculate Object Volumes" + bl_options = {"REGISTER", "UNDO"} def execute(self, context): result = 0 @@ -59,6 +62,7 @@ class CalculateObjectVolumes(bpy.types.Operator): class ExecuteQtoMethod(bpy.types.Operator): bl_idname = "bim.execute_qto_method" bl_label = "Execute Qto Method" + bl_options = {"REGISTER", "UNDO"} def execute(self, context): props = bpy.context.scene.BIMQtoProperties @@ -78,8 +82,12 @@ class ExecuteQtoMethod(bpy.types.Operator): class QuantifyObjects(bpy.types.Operator): bl_idname = "bim.quantify_objects" bl_label = "Quantify Objects" + bl_options = {"REGISTER", "UNDO"} def execute(self, context): + return IfcStore.execute_ifc_operator(self, context) + + def _execute(self, context): props = bpy.context.scene.BIMQtoProperties self.file = IfcStore.get_file() for obj in bpy.context.selected_objects: