mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 02:07:36 +00:00
Add to debug UI an operator to toggle detailed ifcopenshell logs
https://i.imgur.com/tqwRSYs.png Ping @theoryshaw just in case, I can image Ryan finding lots of edge cases in v0.8.0 and this can help narrow them down😁
This commit is contained in:
@@ -40,6 +40,7 @@ classes = (
|
|||||||
operator.SelectExpressFile,
|
operator.SelectExpressFile,
|
||||||
operator.SelectHighPolygonMeshes,
|
operator.SelectHighPolygonMeshes,
|
||||||
operator.SelectHighestPolygonMeshes,
|
operator.SelectHighestPolygonMeshes,
|
||||||
|
operator.ToggleDetailedIOSLogs,
|
||||||
operator.ValidateIfcFile,
|
operator.ValidateIfcFile,
|
||||||
prop.BIMDebugProperties,
|
prop.BIMDebugProperties,
|
||||||
ui.BIM_PT_debug,
|
ui.BIM_PT_debug,
|
||||||
|
|||||||
@@ -724,3 +724,36 @@ class DebugActiveDrawing(bpy.types.Operator):
|
|||||||
|
|
||||||
self.report({"INFO"}, "See system console for the results")
|
self.report({"INFO"}, "See system console for the results")
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
||||||
|
class ToggleDetailedIOSLogs(bpy.types.Operator):
|
||||||
|
bl_idname = "bim.toggle_detailed_ios_logs"
|
||||||
|
bl_label = "Toggle Detailed IfcOpenShell Logs"
|
||||||
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
bl_description = (
|
||||||
|
"Turn on detailed IfcOpenShell logs in the system console.\n"
|
||||||
|
+ "Could be useful debugging issues "
|
||||||
|
+ "loading IFC representations / serializing IFC geometry."
|
||||||
|
+ "\n\nALT+CLICK to disable the logs"
|
||||||
|
)
|
||||||
|
# NOTE: No idea if it's possible to check from Python
|
||||||
|
# whether detailed logs are currently enabled or not.
|
||||||
|
# Therefore we just distinguish between click
|
||||||
|
# and alt-click to allow enabling/disabling the logs.
|
||||||
|
turn_on_logs: bpy.props.BoolProperty(name="Turn On Logs", default=True, options={"SKIP_SAVE"})
|
||||||
|
|
||||||
|
def invoke(self, context, event):
|
||||||
|
if event.type == "LEFTMOUSE" and event.alt:
|
||||||
|
self.turn_on_logs = False
|
||||||
|
return self.execute(context)
|
||||||
|
|
||||||
|
def execute(self, context):
|
||||||
|
import ifcopenshell.ifcopenshell_wrapper as wrapper
|
||||||
|
|
||||||
|
if self.turn_on_logs:
|
||||||
|
wrapper.turn_on_detailed_logging()
|
||||||
|
self.report({"INFO"}, "Detailed IfcOpenShell logs turned on.")
|
||||||
|
else:
|
||||||
|
wrapper.turn_off_detailed_logging()
|
||||||
|
self.report({"INFO"}, "Detailed IfcOpenShell logs turned off.")
|
||||||
|
return {"FINISHED"}
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ class BIM_PT_debug(Panel):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.operator("bim.debug_active_drawing")
|
row.operator("bim.debug_active_drawing")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.operator("bim.toggle_detailed_ios_logs")
|
||||||
|
|
||||||
row = layout.split(factor=0.5, align=True)
|
row = layout.split(factor=0.5, align=True)
|
||||||
row.operator("bim.create_shape_from_step_id").should_include_curves = False
|
row.operator("bim.create_shape_from_step_id").should_include_curves = False
|
||||||
row.operator("bim.create_shape_from_step_id", text="", icon="IPO_ELASTIC").should_include_curves = True
|
row.operator("bim.create_shape_from_step_id", text="", icon="IPO_ELASTIC").should_include_curves = True
|
||||||
|
|||||||
Reference in New Issue
Block a user