mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-03 05:22:06 +00:00
New import code profiler in the IFC debug panel
This commit is contained in:
@@ -49,6 +49,7 @@ if bpy is not None:
|
|||||||
operator.ValidateIfcFile,
|
operator.ValidateIfcFile,
|
||||||
operator.ExportIFC,
|
operator.ExportIFC,
|
||||||
operator.ImportIFC,
|
operator.ImportIFC,
|
||||||
|
operator.ProfileImportIFC,
|
||||||
operator.ColourByClass,
|
operator.ColourByClass,
|
||||||
operator.ColourByAttribute,
|
operator.ColourByAttribute,
|
||||||
operator.ColourByPset,
|
operator.ColourByPset,
|
||||||
|
|||||||
@@ -138,6 +138,19 @@ class ImportIFC(bpy.types.Operator, ImportHelper):
|
|||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
class ProfileImportIFC(bpy.types.Operator):
|
||||||
|
bl_idname = "bim.profile_import_ifc"
|
||||||
|
bl_label = "Profile Import IFC"
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
import cProfile
|
||||||
|
import pstats
|
||||||
|
cProfile.run(f"import bpy; bpy.ops.import_ifc.bim(filepath='{bpy.context.scene.BIMProperties.ifc_file}')", "blender.prof")
|
||||||
|
p = pstats.Stats("blender.prof")
|
||||||
|
p.sort_stats("cumulative").print_stats(50)
|
||||||
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
class SelectGlobalId(bpy.types.Operator):
|
class SelectGlobalId(bpy.types.Operator):
|
||||||
bl_idname = "bim.select_global_id"
|
bl_idname = "bim.select_global_id"
|
||||||
bl_label = "Select GlobalId"
|
bl_label = "Select GlobalId"
|
||||||
|
|||||||
@@ -2541,6 +2541,9 @@ class BIM_PT_debug(Panel):
|
|||||||
scene = context.scene
|
scene = context.scene
|
||||||
props = scene.BIMDebugProperties
|
props = scene.BIMDebugProperties
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.operator("bim.profile_import_ifc")
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(props, "step_id", text="")
|
row.prop(props, "step_id", text="")
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
|
|||||||
Reference in New Issue
Block a user