From 155827528a9336cf4d1ef5ea1eaea812126f93a3 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Mon, 13 Oct 2025 08:08:35 +1100 Subject: [PATCH] Visibility during collector assignment now depends on the visibility mode set in the UI. --- src/bonsai/bonsai/tool/collector.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/bonsai/bonsai/tool/collector.py b/src/bonsai/bonsai/tool/collector.py index 34f471ada4..65d5ae49bd 100644 --- a/src/bonsai/bonsai/tool/collector.py +++ b/src/bonsai/bonsai/tool/collector.py @@ -51,9 +51,13 @@ class Collector(bonsai.core.tool.Collector): if tool.Geometry.is_locked(element): tool.Geometry.lock_object(obj) element = (element.PartOfU or element.PartOfV or element.PartOfW)[0] + if not tool.Spatial.get_grid_props().is_visible: + obj.hide_viewport = True elif element.is_a("IfcGrid"): if tool.Geometry.is_locked(element): tool.Geometry.lock_object(obj) + if not tool.Spatial.get_grid_props().is_visible: + obj.hide_viewport = True if element.is_a("IfcProject"): if tool.Geometry.is_locked(element): @@ -69,7 +73,8 @@ class Collector(bonsai.core.tool.Collector): tool.Geometry.lock_object(obj) collection = cls._create_project_child_collection("IfcSpace") cls.link_collection_object_safe(collection, obj) - obj.hide_viewport = True + if not tool.Spatial.get_spatial_props().is_visible: + obj.hide_viewport = True elif element.is_a("IfcStructuralItem"): collection = cls._create_project_child_collection("IfcStructuralItem") cls.link_collection_object_safe(collection, obj) @@ -93,7 +98,8 @@ class Collector(bonsai.core.tool.Collector): cls.link_collection_object_safe(collection, obj) project_obj = tool.Ifc.get_object(tool.Ifc.get().by_type("IfcProject")[0]) cls.link_collection_child_safe(tool.Blender.get_object_bim_props(project_obj).collection, collection) - obj.hide_viewport = True + if not tool.Spatial.get_spatial_props().is_visible: + obj.hide_viewport = True elif ( tool.Ifc.get_schema() != "IFC2X3" and element.is_a("IfcSpatialElement") @@ -105,7 +111,8 @@ class Collector(bonsai.core.tool.Collector): cls.link_collection_object_safe(collection, obj) project_obj = tool.Ifc.get_object(tool.Ifc.get().by_type("IfcProject")[0]) cls.link_collection_child_safe(tool.Blender.get_object_bim_props(project_obj).collection, collection) - obj.hide_viewport = True + if not tool.Spatial.get_spatial_props().is_visible: + obj.hide_viewport = True elif element.is_a("IfcAnnotation") and element.ObjectType == "DRAWING": if collection := cls._create_own_collection(obj): cls.link_collection_object_safe(collection, obj)