From 4427c738169d774f4cc3310f6103be4d235b2bcf Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 22 Apr 2025 18:44:05 +0500 Subject: [PATCH] bim.override_mesh_separate - handle possible mode mismatch more gracefully Other options LOOSE_PARTS and MATERIAL do support object mode. --- src/bonsai/bonsai/bim/module/geometry/operator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bonsai/bonsai/bim/module/geometry/operator.py b/src/bonsai/bonsai/bim/module/geometry/operator.py index 73fc3a7442..52a6a57db4 100644 --- a/src/bonsai/bonsai/bim/module/geometry/operator.py +++ b/src/bonsai/bonsai/bim/module/geometry/operator.py @@ -97,6 +97,10 @@ class OverrideMeshSeparate(bpy.types.Operator, tool.Ifc.Operator): return self.execute(context) def _execute(self, context): + if self.type == "SELECTED" and context.mode != "EDIT": + self.report({"ERROR"}, "Separate by selection requires EDIT mode.") + return {"CANCELLED"} + non_ifc_objects: list[bpy.types.Object] = [] if len(context.selected_editable_objects) > 1: