bim.activate_model to unhide all objects #5232

Restore old behaviour (new behaviour was introduced by accident in 786b796) where it would unhide all objects instead of keeping only objects in the current drawing.
This commit is contained in:
Andrej730
2024-08-28 18:42:05 +05:00
parent 760816b7f0
commit 691dfb45f0
@@ -1471,9 +1471,17 @@ class ActivateModel(bpy.types.Operator):
CutDecorator.uninstall()
# save current visibility statuses
# Preserve current visibility statuses for:
# - non-ifc objects
# - type product
# - annotations (so we won't unhide other drawings)
ifc_file = tool.Ifc.get()
visibility_status: dict[bpy.types.Object, bool] = {}
drawing_groups = [g for g in ifc_file.by_type("IfcGroup", include_subtypes=False)]
for obj in bpy.data.objects:
element = tool.Ifc.get_entity(obj)
if element and not element.is_a("IfcAnnotation") and not element.is_a("IfcTypeProduct"):
continue
visibility_status[obj] = obj.hide_get()
if not bpy.app.background: