From 253d478fdca5eba3a4a1188162978b7968768f12 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sun, 4 Jul 2021 20:28:21 +1000 Subject: [PATCH] Implement undo for style module operators. See #1475. --- src/blenderbim/blenderbim/bim/module/style/operator.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/blenderbim/blenderbim/bim/module/style/operator.py b/src/blenderbim/blenderbim/bim/module/style/operator.py index c4aba87149..06b33c8a21 100644 --- a/src/blenderbim/blenderbim/bim/module/style/operator.py +++ b/src/blenderbim/blenderbim/bim/module/style/operator.py @@ -21,9 +21,13 @@ def get_colour_settings(material): class EditStyle(bpy.types.Operator): bl_idname = "bim.edit_style" bl_label = "Edit Style" + bl_options = {"REGISTER", "UNDO"} material: bpy.props.StringProperty() def execute(self, context): + return IfcStore.execute_ifc_operator(self, context) + + def _execute(self, context): self.file = IfcStore.get_file() material = bpy.data.objects.get(self.material) if self.material else bpy.context.active_object.active_material settings = get_colour_settings(material) @@ -55,6 +59,7 @@ class AddStyle(bpy.types.Operator): class UnlinkStyle(bpy.types.Operator): bl_idname = "bim.unlink_style" bl_label = "Unlink Style" + bl_options = {"REGISTER", "UNDO"} material: bpy.props.StringProperty() def execute(self, context):