From 011fb6660ac36607a7e9685d9e99937aaa1b95bf Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Fri, 20 Mar 2026 19:06:04 -0500 Subject: [PATCH] Add ALT+Click unhide to select_linked_aggregates ALT+Click now unhides hidden objects (viewport and local hide) before selecting, matching the behavior added to other select operators. Generated with the assistance of an AI coding tool. --- .../bonsai/bim/module/aggregate/operator.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/aggregate/operator.py b/src/bonsai/bonsai/bim/module/aggregate/operator.py index 98bc612784..91e438f2ff 100644 --- a/src/bonsai/bonsai/bim/module/aggregate/operator.py +++ b/src/bonsai/bonsai/bim/module/aggregate/operator.py @@ -407,13 +407,18 @@ class BIM_OT_select_linked_aggregates(bpy.types.Operator): bl_label = "Select linked aggregates" bl_options = {"REGISTER", "UNDO"} select_parts: bpy.props.BoolProperty(default=False) + should_unhide: bpy.props.BoolProperty(default=False, options={"SKIP_SAVE"}) @classmethod def description(cls, context, properties): if properties.select_parts: - return "Select all aggregates, subaggregates and all their parts" + return "Select all aggregates, subaggregates and all their parts\n\nALT+Click to also unhide hidden objects (viewport and local hide)" else: - return "Select all aggregates" + return "Select all aggregates\n\nALT+Click to also unhide hidden objects (viewport and local hide)" + + def invoke(self, context, event): + self.should_unhide = event.alt + return self.execute(context) def execute(self, context): for obj in context.selected_objects: @@ -446,11 +451,18 @@ class BIM_OT_select_linked_aggregates(bpy.types.Operator): for element in parts_objs: obj = tool.Ifc.get_object(element) if obj: + if self.should_unhide: + obj.hide_viewport = False + obj.hide_set(False) obj.select_set(True) else: for element in parts: obj = tool.Ifc.get_object(element) - obj.select_set(True) + if obj: + if self.should_unhide: + obj.hide_viewport = False + obj.hide_set(False) + obj.select_set(True) return {"FINISHED"}