Add ALT+Click unhide to select_decomposed_elements

Moves "select all listed elements" from ALT to SHIFT,
freeing ALT+Click to unhide hidden objects (viewport
and local hide) before selecting.

Generated with the assistance of an AI coding tool.
This commit is contained in:
Ryan Schultz
2026-03-20 19:20:43 -05:00
parent 011fb6660a
commit 15228ac8b5
@@ -428,24 +428,29 @@ class SelectDecomposedElements(bpy.types.Operator):
should_filter: bpy.props.BoolProperty(name="Should Filter", default=True, options={"SKIP_SAVE"}) should_filter: bpy.props.BoolProperty(name="Should Filter", default=True, options={"SKIP_SAVE"})
container: bpy.props.IntProperty() container: bpy.props.IntProperty()
is_recursive: bpy.props.BoolProperty(default=True, options={"SKIP_SAVE"}) is_recursive: bpy.props.BoolProperty(default=True, options={"SKIP_SAVE"})
should_unhide: bpy.props.BoolProperty(default=False, options={"SKIP_SAVE"})
@classmethod @classmethod
def description(cls, context, operator): def description(cls, context, operator):
return ( return (
"Select the active item" "Select the active item"
+ "\nALT+CLICK to select all listed elements.\nCTRL + CLICK to select only one level deep" + "\nSHIFT+CLICK to select all listed elements.\nCTRL+CLICK to select only one level deep"
+ "\nALT+CLICK to also unhide hidden objects (viewport and local hide)"
) )
def invoke(self, context, event): def invoke(self, context, event):
if event.type == "LEFTMOUSE": if event.type == "LEFTMOUSE":
if event.alt: if event.shift:
self.should_filter = False self.should_filter = False
if event.ctrl: if event.ctrl:
self.is_recursive = False self.is_recursive = False
self.should_unhide = event.alt
return self.execute(context) return self.execute(context)
def execute(self, context): def execute(self, context):
tool.Spatial.select_products(tool.Spatial.get_filtered_elements(self.should_filter, self.is_recursive)) tool.Spatial.select_products(
tool.Spatial.get_filtered_elements(self.should_filter, self.is_recursive), unhide=self.should_unhide
)
# Make selected active element in list, the active object # Make selected active element in list, the active object
props = tool.Spatial.get_spatial_props() props = tool.Spatial.get_spatial_props()