From 30dbf48f6df47865f00b38db25e5dab4905421a1 Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Thu, 18 Dec 2025 10:28:58 -0600 Subject: [PATCH] Extending https://github.com/IfcOpenShell/IfcOpenShell/commit/3ebb046619e43a1f42087e95fb9be1959cbfe0a4: Force UI redraw to flush pending Blender operations, as Blender was crashing during bulk printing. Not 100% this fixed everything, as there are a few crashes that spring up still, but is better. --- src/bonsai/bonsai/bim/module/drawing/operator.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bonsai/bonsai/bim/module/drawing/operator.py b/src/bonsai/bonsai/bim/module/drawing/operator.py index e4f258c6e1..6d495849fe 100644 --- a/src/bonsai/bonsai/bim/module/drawing/operator.py +++ b/src/bonsai/bonsai/bim/module/drawing/operator.py @@ -299,6 +299,14 @@ class CreateDrawing(bpy.types.Operator): original_cache_setting = self.props.should_use_underlay_cache self.props.should_use_underlay_cache = False + # Force Blender to process all pending operations + for area in context.screen.areas: + area.tag_redraw() + + # Process events to let Blender finish internal cleanup + bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1) + + self.camera = context.scene.camera assert (camera_element := tool.Ifc.get_entity(self.camera)) self.camera_element = camera_element