mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix representation items / booleans UI prioritizing item mode object over active obj
It led to confusion when object A would be in Item Mode and you open properties for object B and try to show rep items for B and UI would be unresponsive.
This commit is contained in:
@@ -225,7 +225,7 @@ class BIM_PT_representation_items(Panel):
|
||||
RepresentationItemsData.load()
|
||||
|
||||
props = tool.Geometry.get_geometry_props()
|
||||
obj = props.representation_obj or tool.Blender.get_active_object()
|
||||
obj = tool.Geometry.get_active_or_representation_obj()
|
||||
assert obj
|
||||
props = tool.Geometry.get_object_geometry_props(obj)
|
||||
|
||||
|
||||
@@ -118,23 +118,24 @@ class BooleansData:
|
||||
|
||||
@classmethod
|
||||
def load(cls):
|
||||
# Only called when some object is active.
|
||||
cls.data = {}
|
||||
cls.data["total_booleans"] = cls.booleans()
|
||||
cls.data["manual_booleans"] = cls.manual_booleans()
|
||||
cls.is_loaded = True
|
||||
|
||||
@classmethod
|
||||
def booleans(cls):
|
||||
props = tool.Geometry.get_geometry_props()
|
||||
obj = props.representation_obj or bpy.context.active_object
|
||||
def booleans(cls) -> list[ifcopenshell.entity_instance]:
|
||||
obj = tool.Geometry.get_active_or_representation_obj()
|
||||
assert obj
|
||||
if not (representation := tool.Geometry.get_active_representation(obj)):
|
||||
return []
|
||||
return tool.Model.get_booleans(representation=representation)
|
||||
|
||||
@classmethod
|
||||
def manual_booleans(cls):
|
||||
props = tool.Geometry.get_geometry_props()
|
||||
obj = props.representation_obj or bpy.context.active_object
|
||||
def manual_booleans(cls) -> list[ifcopenshell.entity_instance]:
|
||||
obj = tool.Geometry.get_active_or_representation_obj()
|
||||
assert obj
|
||||
if not (representation := tool.Geometry.get_active_representation(obj)):
|
||||
return []
|
||||
return tool.Model.get_manual_booleans(tool.Ifc.get_entity(obj), representation=representation)
|
||||
|
||||
Reference in New Issue
Block a user