Fix #7519. Do not import parametrically locked item attributes.

The previous fix by @theoryshaw had the correct conclusion but had some
issues:

 1. Don't implement anything that fetches IFC data in the UI draw calls.
This historically has lead to race conditions and crashes. The data
classes are much preferred.
 2. Rather than load the inapplicable attribute then selectively omit it
in the UI, it's preferred to just never load it in the first place.
This commit is contained in:
Dion Moult
2026-01-25 14:16:35 +11:00
parent 12f8863014
commit 0e4f2fada1
+4
View File
@@ -1797,6 +1797,10 @@ class Geometry(bonsai.core.tool.Geometry):
def import_item_attributes(cls, obj: bpy.types.Object) -> None:
props = tool.Geometry.get_mesh_props(obj.data)
props.item_attributes.clear()
element = tool.Ifc.get_entity(tool.Geometry.get_geometry_props().representation_obj)
if tool.Model.get_usage_type(element) == "LAYER3":
return # All LAYER3 attributes are parametrically determined from the IfcMaterialLayerSet
item = tool.Ifc.get().by_id(props.ifc_definition_id)
allowed_attributes = [
a.name()