Fix #7205. Regression when switching from drawing mode to model mode didn't hide drawings.

This commit is contained in:
Dion Moult
2025-10-12 21:21:27 +11:00
parent d3a5071d9d
commit 0073a4c0a2
2 changed files with 8 additions and 0 deletions
@@ -2226,6 +2226,7 @@ class ActivateModel(bpy.types.Operator):
)
tool.Blender.reset_object_visibility()
tool.Drawing.hide_all_drawing_collections()
tool.Blender.update_viewport()
bonsai.bim.handler.refresh_ui_data()
+7
View File
@@ -2591,3 +2591,10 @@ class Drawing(bonsai.core.tool.Drawing):
ifcopenshell.api.document.remove_reference(tool.Ifc.get(), reference=reference)
tool.Drawing.import_sheets()
@classmethod
def hide_all_drawing_collections(cls) -> None:
for element in tool.Ifc.get().by_type("IfcAnnotation"):
if element.ObjectType == "DRAWING" and (obj := tool.Ifc.get_object(element)):
print('found element', element)
tool.Blender.get_layer_collection(obj.users_collection[0]).hide_viewport = True