Add ALT+Click unhide to select_similar_type

ALT+Click now unhides hidden objects (viewport and local
hide) before selecting, matching the behavior added to
select_ifc_class and select_similar.

Generated with the assistance of an AI coding tool.
This commit is contained in:
Ryan Schultz
2026-03-20 12:33:51 -05:00
parent 1ce62c948c
commit ea27b4f3ae
+11 -1
View File
@@ -221,10 +221,17 @@ class SelectType(bpy.types.Operator):
class SelectSimilarType(bpy.types.Operator):
"""Select Similar Type\nALT+Click to also unhide hidden objects (viewport and local hide)"""
bl_idname = "bim.select_similar_type"
bl_label = "Select Similar Type"
bl_options = {"REGISTER", "UNDO"}
related_object: bpy.props.StringProperty()
should_unhide: bpy.props.BoolProperty(default=False, options={"SKIP_SAVE"})
def invoke(self, context, event):
self.should_unhide = event.alt
return self.execute(context)
def execute(self, context):
self.file = tool.Ifc.get()
@@ -246,7 +253,10 @@ class SelectSimilarType(bpy.types.Operator):
for element in related_objects:
obj = tool.Ifc.get_object(element)
if obj and obj in context.visible_objects:
if obj and (self.should_unhide or obj in context.visible_objects):
if self.should_unhide:
obj.hide_viewport = False
obj.hide_set(False)
obj.select_set(True)
# copy selection query to clipboard