Lock all representation items that are not movable

Otherwise it was confusing that user can move item but when they exit item mode position was lost
This commit is contained in:
Andrej730
2024-09-26 12:12:11 +05:00
parent 340e8515f5
commit 8814d3a22b
2 changed files with 5 additions and 1 deletions
@@ -2357,7 +2357,7 @@ class ImportRepresentationItems(bpy.types.Operator, tool.Ifc.Operator):
tool.Geometry.import_item(item_obj)
tool.Geometry.import_item_attributes(item_obj)
if tool.Geometry.is_meshlike_item(item):
if not tool.Geometry.is_movable(item):
tool.Geometry.lock_object(item_obj)
tool.Root.reload_item_decorator()
+4
View File
@@ -842,6 +842,10 @@ class Geometry(bonsai.core.tool.Geometry):
def is_meshlike_item(cls, item: ifcopenshell.entity_instance) -> bool:
return item.is_a("IfcTessellatedItem") or item.is_a("IfcManifoldSolidBrep")
@classmethod
def is_movable(cls, item: ifcopenshell.entity_instance) -> bool:
return item.is_a("IfcSweptAreaSolid")
@classmethod
def is_profile_based(cls, data: bpy.types.Mesh) -> bool:
return data.BIMMeshProperties.subshape_type == "PROFILE"