mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 14:31:39 +00:00
mesh.separate works completely different in EDIT mode, previously we only supported it from object mode
This commit is contained in:
@@ -99,8 +99,18 @@ class OverrideMeshSeparate(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
return self.execute(context)
|
return self.execute(context)
|
||||||
|
|
||||||
def _execute(self, context):
|
def _execute(self, context):
|
||||||
if self.type == "SELECTED" and context.mode != "EDIT":
|
if not tool.Ifc.get():
|
||||||
self.report({"ERROR"}, "Separate by selection requires EDIT mode.")
|
return bpy.ops.mesh.separate(type=self.type)
|
||||||
|
elif context.mode == "EDIT_MESH":
|
||||||
|
if any(
|
||||||
|
tool.Ifc.get_entity(obj) or tool.Geometry.is_representation_item(obj) for obj in context.objects_in_mode
|
||||||
|
):
|
||||||
|
self.report({"WARNING"}, "IFC Separate is not yet supported for EDIT mode with IFC elements.")
|
||||||
|
return {"CANCELLED"}
|
||||||
|
return bpy.ops.mesh.separate(type=self.type)
|
||||||
|
|
||||||
|
if self.type == "SELECTED":
|
||||||
|
self.report({"ERROR"}, "Separate by selection requires 'EDIT_MESH' mode.")
|
||||||
return {"CANCELLED"}
|
return {"CANCELLED"}
|
||||||
|
|
||||||
non_ifc_objects: list[bpy.types.Object] = []
|
non_ifc_objects: list[bpy.types.Object] = []
|
||||||
|
|||||||
Reference in New Issue
Block a user