Create shape debugger now includes time information.

This commit is contained in:
Dion Moult
2021-09-15 12:43:12 +10:00
parent 2dc6a3bcc6
commit e7a8780828
@@ -17,6 +17,7 @@
# along with BlenderBIM Add-on. If not, see <http://www.gnu.org/licenses/>.
import bpy
import time
import logging
import ifcopenshell
import ifcopenshell.util.placement
@@ -87,10 +88,7 @@ class ProfileImportIFC(bpy.types.Operator):
import cProfile
import pstats
# For Windows
filepath = context.scene.BIMProperties.ifc_file.replace("\\", "\\\\")
cProfile.run(f"import bpy; bpy.ops.import_ifc.bim(filepath='{filepath}')", "blender.prof")
cProfile.run("import bpy; bpy.ops.bim.load_project_elements()", "blender.prof")
p = pstats.Stats("blender.prof")
p.sort_stats("cumulative").print_stats(50)
return {"FINISHED"}
@@ -115,9 +113,10 @@ class CreateAllShapes(bpy.types.Operator):
if element.GlobalId in excludes:
continue
print(f"{i}/{total}:", element)
start = time.time()
try:
shape = ifcopenshell.geom.create_shape(settings, element)
print("Success", len(shape.geometry.verts), len(shape.geometry.edges), len(shape.geometry.faces))
print("Success", time.time()-start, len(shape.geometry.verts), len(shape.geometry.edges), len(shape.geometry.faces))
except:
failures.append(element)
print("***** FAILURE *****")