Skip to content

Commit f0d8a6f

Browse files
committed
Add ALT+Click unhide to select_aggregate
When ALT is held, BIM_OT_select_aggregate now clears hide_viewport and hide_set on matched objects before selecting, consistent with the pattern used across other selection operators on this branch. Generated with the assistance of an AI coding tool.
1 parent 2ad30a0 commit f0d8a6f

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/bonsai/bonsai/bim/module/aggregate/operator.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,17 +266,19 @@ class BIM_OT_select_aggregate(bpy.types.Operator):
266266
one_level_deep: bpy.props.BoolProperty(
267267
name="One Level Deep", description="Select only immediate children, not recursively", default=False
268268
)
269+
should_unhide: bpy.props.BoolProperty(default=False, options={"SKIP_SAVE"})
269270

270271
@classmethod
271272
def description(cls, context, properties):
272273
if properties.select_parts:
273-
return "Select Aggregate and Parts.\n\nCtrl+click to select only one level deep"
274+
return "Select Aggregate and Parts.\n\nCtrl+click to select only one level deep\nALT+Click to also unhide hidden objects (viewport and local hide)"
274275
else:
275-
return "Select Aggregate"
276+
return "Select Aggregate\n\nALT+Click to also unhide hidden objects (viewport and local hide)"
276277

277278
def invoke(self, context, event):
278279
if event.type == "LEFTMOUSE" and event.ctrl:
279280
self.one_level_deep = True
281+
self.should_unhide = event.alt
280282
return self.execute(context)
281283

282284
def execute(self, context):
@@ -317,12 +319,18 @@ def add_descendants(elem):
317319
for element in set(selected_parts + all_parts):
318320
obj = tool.Ifc.get_object(element)
319321
if obj:
322+
if self.should_unhide:
323+
obj.hide_viewport = False
324+
obj.hide_set(False)
320325
obj.select_set(True)
321326

322327
else:
323328
for aggregate_element in all_parts:
324329
aggregate_obj = tool.Ifc.get_object(aggregate_element)
325330
if aggregate_obj:
331+
if self.should_unhide:
332+
aggregate_obj.hide_viewport = False
333+
aggregate_obj.hide_set(False)
326334
aggregate_obj.select_set(True)
327335
bpy.context.view_layer.objects.active = aggregate_obj
328336

0 commit comments

Comments
 (0)