From 431cf435efc153e79dc1d2ddd44d3569f3fb633f Mon Sep 17 00:00:00 2001 From: falken10vdl <33285113+falken10vdl@users.noreply.github.com> Date: Mon, 1 Jun 2026 14:02:28 +0200 Subject: [PATCH] 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! --- src/bonsai/bonsai/core/spatial.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/core/spatial.py b/src/bonsai/bonsai/core/spatial.py index 5ce6d7c253..3af14821a2 100644 --- a/src/bonsai/bonsai/core/spatial.py +++ b/src/bonsai/bonsai/core/spatial.py @@ -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: