Implement undo in debug and diff operators.

This commit is contained in:
Dion Moult
2021-07-06 16:03:27 +10:00
parent c687e9af05
commit 3dcd10b478
2 changed files with 9 additions and 0 deletions
@@ -76,8 +76,12 @@ class CreateAllShapes(bpy.types.Operator):
class CreateShapeFromStepId(bpy.types.Operator):
bl_idname = "bim.create_shape_from_step_id"
bl_label = "Create Shape From STEP ID"
bl_options = {"REGISTER", "UNDO"}
def execute(self, context):
return IfcStore.execute_ifc_operator(self, context)
def _execute(self, context):
logger = logging.getLogger("ImportIFC")
self.ifc_import_settings = import_ifc.IfcImportSettings.factory(bpy.context, IfcStore.path, logger)
self.file = IfcStore.get_file()
@@ -96,6 +100,7 @@ class CreateShapeFromStepId(bpy.types.Operator):
class SelectHighPolygonMeshes(bpy.types.Operator):
bl_idname = "bim.select_high_polygon_meshes"
bl_label = "Select High Polygon Meshes"
bl_options = {"REGISTER", "UNDO"}
def execute(self, context):
results = {}
@@ -9,6 +9,7 @@ from blenderbim.bim.ifc import IfcStore
class SelectDiffJsonFile(bpy.types.Operator):
bl_idname = "bim.select_diff_json_file"
bl_label = "Select Diff JSON File"
bl_options = {"REGISTER", "UNDO"}
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
def execute(self, context):
@@ -23,6 +24,7 @@ class SelectDiffJsonFile(bpy.types.Operator):
class VisualiseDiff(bpy.types.Operator):
bl_idname = "bim.visualise_diff"
bl_label = "Visualise Diff"
bl_options = {"REGISTER", "UNDO"}
def execute(self, context):
#ifc_file = IfcStore.get_file() # In case we get from Store
@@ -48,6 +50,7 @@ class VisualiseDiff(bpy.types.Operator):
class SelectDiffOldFile(bpy.types.Operator):
bl_idname = "bim.select_diff_old_file"
bl_label = "Select Diff Old File"
bl_options = {"REGISTER", "UNDO"}
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
def execute(self, context):
@@ -62,6 +65,7 @@ class SelectDiffOldFile(bpy.types.Operator):
class SelectDiffNewFile(bpy.types.Operator):
bl_idname = "bim.select_diff_new_file"
bl_label = "Select Diff New File"
bl_options = {"REGISTER", "UNDO"}
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
def execute(self, context):