mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-07 12:56:26 +00:00
Consolidate duplicate operators "Convert to Blender file" and "Purge IFC Links"
This commit is contained in:
@@ -35,7 +35,6 @@ classes = (
|
|||||||
operator.PrintUnusedElementStats,
|
operator.PrintUnusedElementStats,
|
||||||
operator.ProfileImportIFC,
|
operator.ProfileImportIFC,
|
||||||
operator.PurgeHdf5Cache,
|
operator.PurgeHdf5Cache,
|
||||||
operator.PurgeIfcLinks,
|
|
||||||
operator.PurgeUnusedElementsByClass,
|
operator.PurgeUnusedElementsByClass,
|
||||||
operator.RewindInspector,
|
operator.RewindInspector,
|
||||||
operator.SelectExpressFile,
|
operator.SelectExpressFile,
|
||||||
|
|||||||
@@ -104,10 +104,11 @@ class PrintIfcFile(bpy.types.Operator):
|
|||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class PurgeIfcLinks(bpy.types.Operator):
|
class ConvertToBlender(bpy.types.Operator):
|
||||||
bl_idname = "bim.purge_ifc_links"
|
bl_idname = "bim.convert_to_blender"
|
||||||
bl_label = "Purge IFC Links"
|
bl_label = "Convert To Blender File"
|
||||||
bl_description = "Purge all definitions and references from the file.\nWarning : Cannot be undone."
|
bl_description = "Removes all IFC data and revert to basic Blender objects.\nWarning : Cannot be undone."
|
||||||
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
for obj in bpy.data.objects:
|
for obj in bpy.data.objects:
|
||||||
@@ -124,26 +125,6 @@ class PurgeIfcLinks(bpy.types.Operator):
|
|||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class ConvertToBlender(bpy.types.Operator):
|
|
||||||
bl_idname = "bim.convert_to_blender"
|
|
||||||
bl_label = "Convert To Blender File"
|
|
||||||
bl_description = "Removes all IFC data, and converts the file to a simple Blender file."
|
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
|
||||||
|
|
||||||
def execute(self, context):
|
|
||||||
for o in bpy.data.objects:
|
|
||||||
if o.type in {"MESH", "EMPTY"}:
|
|
||||||
o.BIMObjectProperties.ifc_definition_id = 0
|
|
||||||
if o.data:
|
|
||||||
o.data.BIMMeshProperties.ifc_definition_id = 0
|
|
||||||
for m in bpy.data.materials:
|
|
||||||
m.BIMMaterialProperties.ifc_style_id = False
|
|
||||||
bpy.context.scene.BIMProperties.ifc_file = ""
|
|
||||||
IfcStore.purge()
|
|
||||||
blenderbim.bim.handler.refresh_ui_data()
|
|
||||||
return {"FINISHED"}
|
|
||||||
|
|
||||||
|
|
||||||
class ValidateIfcFile(bpy.types.Operator):
|
class ValidateIfcFile(bpy.types.Operator):
|
||||||
bl_idname = "bim.validate_ifc_file"
|
bl_idname = "bim.validate_ifc_file"
|
||||||
bl_label = "Validate IFC File"
|
bl_label = "Validate IFC File"
|
||||||
|
|||||||
@@ -60,9 +60,6 @@ class BIM_PT_debug(Panel):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.operator("bim.purge_hdf5_cache")
|
row.operator("bim.purge_hdf5_cache")
|
||||||
|
|
||||||
row = layout.row()
|
|
||||||
row.operator("bim.purge_ifc_links")
|
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.operator("bim.update_representation", text="Manually Save Representation")
|
row.operator("bim.update_representation", text="Manually Save Representation")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user