mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 14:23:53 +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()
|
bpy.ops.bim.unjoin_walls()
|
||||||
|
|
||||||
def hotkey_A_D(self):
|
def hotkey_A_D(self):
|
||||||
if not bpy.context.selected_objects:
|
if not tool.Blender.get_selected_objects():
|
||||||
return
|
return
|
||||||
bpy.ops.bim.select_decomposition()
|
bpy.ops.bim.select_decomposition()
|
||||||
|
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ class SelectDecomposition(bpy.types.Operator):
|
|||||||
bl_options = {"REGISTER", "UNDO"}
|
bl_options = {"REGISTER", "UNDO"}
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
for obj in context.selected_objects:
|
for obj in tool.Blender.get_selected_objects():
|
||||||
element = tool.Ifc.get_entity(obj)
|
element = tool.Ifc.get_entity(obj)
|
||||||
if not element:
|
if not element:
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ class Blender(bonsai.core.tool.Blender):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_selected_objects(cls) -> set[bpy.types.Object]:
|
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 selected_objects := getattr(bpy.context, "selected_objects", None):
|
||||||
if active_obj := cls.get_active_object():
|
if active_obj := cls.get_active_object():
|
||||||
return set(selected_objects + [active_obj])
|
return set(selected_objects + [active_obj])
|
||||||
|
|||||||
Reference in New Issue
Block a user