From ab057e3eff74ca736face1f05198a10ee72580b4 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Fri, 5 Mar 2021 10:02:29 +1100 Subject: [PATCH] Fix bug where you couldn't do import profiling on Windows. Thanks erab! --- src/ifcblenderexport/blenderbim/bim/module/debug/operator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ifcblenderexport/blenderbim/bim/module/debug/operator.py b/src/ifcblenderexport/blenderbim/bim/module/debug/operator.py index cec906666d..9134e665f1 100644 --- a/src/ifcblenderexport/blenderbim/bim/module/debug/operator.py +++ b/src/ifcblenderexport/blenderbim/bim/module/debug/operator.py @@ -13,8 +13,11 @@ class ProfileImportIFC(bpy.types.Operator): import cProfile import pstats + # For Windows + filepath = bpy.context.scene.BIMProperties.ifc_file.replace('\\', '\\\\') + cProfile.run( - f"import bpy; bpy.ops.import_ifc.bim(filepath='{bpy.context.scene.BIMProperties.ifc_file}')", "blender.prof" + f"import bpy; bpy.ops.import_ifc.bim(filepath='{filepath}')", "blender.prof" ) p = pstats.Stats("blender.prof") p.sort_stats("cumulative").print_stats(50)