mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 18:21:59 +00:00
#2652 Removes all IFC data, and converts the file to a simple Blender file
This commit is contained in:
@@ -30,6 +30,7 @@ classes = (
|
|||||||
operator.ProfileImportIFC,
|
operator.ProfileImportIFC,
|
||||||
operator.PurgeHdf5Cache,
|
operator.PurgeHdf5Cache,
|
||||||
operator.PurgeIfcLinks,
|
operator.PurgeIfcLinks,
|
||||||
|
operator.ConvertToBlender,
|
||||||
operator.RewindInspector,
|
operator.RewindInspector,
|
||||||
operator.SelectExpressFile,
|
operator.SelectExpressFile,
|
||||||
operator.SelectHighPolygonMeshes,
|
operator.SelectHighPolygonMeshes,
|
||||||
|
|||||||
@@ -65,6 +65,26 @@ class PurgeIfcLinks(bpy.types.Operator):
|
|||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
class ConvertToBlender(bpy.types.Operator):
|
||||||
|
bl_idname = "bim.converttoblender"
|
||||||
|
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.purge_module_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"
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ class BIM_PT_debug(Panel):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.operator("bim.purge_ifc_links")
|
row.operator("bim.purge_ifc_links")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.operator("bim.converttoblender")
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.operator("bim.create_all_shapes")
|
row.operator("bim.create_all_shapes")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user