mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 18:21:59 +00:00
have it only work on 1 object, at a time.
This commit is contained in:
@@ -2575,6 +2575,16 @@ class DirectProfileEdit(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
|
# Ensure we're only working with the active object
|
||||||
|
# Deselect all other objects if multiple are selected
|
||||||
|
active_obj = context.active_object
|
||||||
|
if active_obj and context.mode == "OBJECT":
|
||||||
|
if len(context.selected_objects) > 1:
|
||||||
|
self.report({"WARNING"}, "Currently Direct Profile Edit only works on one object at a time. Operating on active object only.")
|
||||||
|
bpy.ops.object.select_all(action='DESELECT')
|
||||||
|
active_obj.select_set(True)
|
||||||
|
context.view_layer.objects.active = active_obj
|
||||||
|
|
||||||
# If we're already in edit mode, exit to object mode and SAVE changes
|
# If we're already in edit mode, exit to object mode and SAVE changes
|
||||||
if context.mode in ("EDIT_MESH", "EDIT_CURVE"):
|
if context.mode in ("EDIT_MESH", "EDIT_CURVE"):
|
||||||
return self.handle_exit_edit_mode(context)
|
return self.handle_exit_edit_mode(context)
|
||||||
|
|||||||
Reference in New Issue
Block a user