Fix linked drawings hidden on drawing activation

Link empty handles were missing from visible_objects, so linked
models were always hidden when activating a drawing.

Generated with the assistance of an AI coding tool.
This commit is contained in:
Bruno Postle
2026-07-03 11:25:19 +01:00
parent 0aaafaedc9
commit df27f86237
+10 -1
View File
@@ -2577,10 +2577,19 @@ class Drawing(bonsai.core.tool.Drawing):
has_context = True
break
linked_handles: set[bpy.types.Object] = set()
for link in tool.Project.get_project_props().get_loaded_links_for_drawings():
try:
handle = tool.Project.get_link_empty_handle(link)
except Exception:
continue
if handle:
linked_handles.add(handle)
visible_objects = []
for obj in bpy.context.view_layer.objects:
if element := tool.Ifc.get_entity(obj):
if element in filtered_elements:
if element in filtered_elements or obj in linked_handles:
visible_objects.append(obj)
else:
if obj.hide_get() is False: