Fix assign_container in spatial.py (#8079)

ifc.get_object(element) can return None for IFC elements that aren't loaded as Blender objects (e.g., decomposed sub-elements). 
The loop now skips those instead of passing None into collector.assign().

Cheers!
This commit is contained in:
falken10vdl
2026-06-01 14:02:28 +02:00
committed by GitHub
parent a433f56337
commit 431cf435ef
+2 -1
View File
@@ -67,7 +67,8 @@ def assign_container(
if products := [e for e in root_elements if spatial.can_contain(container, root_element)]:
ifc.run("spatial.assign_container", products=products, relating_structure=container)
for element in all_elements:
collector.assign(ifc.get_object(element))
if obj := ifc.get_object(element):
collector.assign(obj)
def enable_editing_container(spatial: type[tool.Spatial], obj: bpy.types.Object) -> None: