mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 11:18:18 +00:00
Disable edit mode on non mesh-like representations as well to prevent risk of invalid geometry.
This commit is contained in:
@@ -742,8 +742,11 @@ class OverrideModeSetEdit(bpy.types.Operator):
|
|||||||
obj.select_set(False)
|
obj.select_set(False)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if obj.data.BIMMeshProperties.ifc_definition_id:
|
representation = tool.Geometry.get_active_representation(obj)
|
||||||
representation = tool.Ifc.get().by_id(obj.data.BIMMeshProperties.ifc_definition_id)
|
if not representation:
|
||||||
|
obj.select_set(False)
|
||||||
|
continue
|
||||||
|
|
||||||
if representation.RepresentationType in ("Tessellation", "Brep"):
|
if representation.RepresentationType in ("Tessellation", "Brep"):
|
||||||
if element.HasOpenings:
|
if element.HasOpenings:
|
||||||
# Mesh elements with openings must disable openings
|
# Mesh elements with openings must disable openings
|
||||||
@@ -759,6 +762,10 @@ class OverrideModeSetEdit(bpy.types.Operator):
|
|||||||
apply_openings=False,
|
apply_openings=False,
|
||||||
)
|
)
|
||||||
obj.data.BIMMeshProperties.mesh_checksum = tool.Geometry.get_mesh_checksum(obj.data)
|
obj.data.BIMMeshProperties.mesh_checksum = tool.Geometry.get_mesh_checksum(obj.data)
|
||||||
|
else:
|
||||||
|
obj.select_set(False)
|
||||||
|
continue
|
||||||
|
|
||||||
if not context.selected_objects:
|
if not context.selected_objects:
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
bpy.ops.object.mode_set(mode="EDIT", toggle=True)
|
bpy.ops.object.mode_set(mode="EDIT", toggle=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user