mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-11 14:22:33 +00:00
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:
@@ -221,10 +221,17 @@ class SelectType(bpy.types.Operator):
|
|||||||
|
|
||||||
|
|
||||||
class SelectSimilarType(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_idname = "bim.select_similar_type"
|
||||||
bl_label = "Select Similar Type"
|
bl_label = "Select Similar Type"
|
||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
related_object: bpy.props.StringProperty()
|
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):
|
def execute(self, context):
|
||||||
self.file = tool.Ifc.get()
|
self.file = tool.Ifc.get()
|
||||||
@@ -246,7 +253,10 @@ class SelectSimilarType(bpy.types.Operator):
|
|||||||
|
|
||||||
for element in related_objects:
|
for element in related_objects:
|
||||||
obj = tool.Ifc.get_object(element)
|
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)
|
obj.select_set(True)
|
||||||
|
|
||||||
# copy selection query to clipboard
|
# copy selection query to clipboard
|
||||||
|
|||||||
Reference in New Issue
Block a user