Implement undo for style module operators. See #1475.

This commit is contained in:
Dion Moult
2021-07-04 20:28:21 +10:00
parent 549bc0e1a9
commit 253d478fdc
@@ -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):