mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
select decomposition to work on unselectable elements #5739
E.g. ifcspaces or other spatial elements are unselectable by default.
This commit is contained in:
@@ -1197,7 +1197,7 @@ class Hotkey(bpy.types.Operator, tool.Ifc.Operator):
|
||||
bpy.ops.bim.unjoin_walls()
|
||||
|
||||
def hotkey_A_D(self):
|
||||
if not bpy.context.selected_objects:
|
||||
if not tool.Blender.get_selected_objects():
|
||||
return
|
||||
bpy.ops.bim.select_decomposition()
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ class SelectDecomposition(bpy.types.Operator):
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
def execute(self, context):
|
||||
for obj in context.selected_objects:
|
||||
for obj in tool.Blender.get_selected_objects():
|
||||
element = tool.Ifc.get_entity(obj)
|
||||
if not element:
|
||||
continue
|
||||
|
||||
@@ -147,6 +147,7 @@ class Blender(bonsai.core.tool.Blender):
|
||||
|
||||
@classmethod
|
||||
def get_selected_objects(cls) -> set[bpy.types.Object]:
|
||||
"""Get selected objects including active object."""
|
||||
if selected_objects := getattr(bpy.context, "selected_objects", None):
|
||||
if active_obj := cls.get_active_object():
|
||||
return set(selected_objects + [active_obj])
|
||||
|
||||
Reference in New Issue
Block a user