mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 14:02:27 +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()
|
RepresentationItemsData.load()
|
||||||
|
|
||||||
props = tool.Geometry.get_geometry_props()
|
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
|
assert obj
|
||||||
props = tool.Geometry.get_object_geometry_props(obj)
|
props = tool.Geometry.get_object_geometry_props(obj)
|
||||||
|
|
||||||
|
|||||||
@@ -118,23 +118,24 @@ class BooleansData:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls):
|
def load(cls):
|
||||||
|
# Only called when some object is active.
|
||||||
cls.data = {}
|
cls.data = {}
|
||||||
cls.data["total_booleans"] = cls.booleans()
|
cls.data["total_booleans"] = cls.booleans()
|
||||||
cls.data["manual_booleans"] = cls.manual_booleans()
|
cls.data["manual_booleans"] = cls.manual_booleans()
|
||||||
cls.is_loaded = True
|
cls.is_loaded = True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def booleans(cls):
|
def booleans(cls) -> list[ifcopenshell.entity_instance]:
|
||||||
props = tool.Geometry.get_geometry_props()
|
obj = tool.Geometry.get_active_or_representation_obj()
|
||||||
obj = props.representation_obj or bpy.context.active_object
|
assert obj
|
||||||
if not (representation := tool.Geometry.get_active_representation(obj)):
|
if not (representation := tool.Geometry.get_active_representation(obj)):
|
||||||
return []
|
return []
|
||||||
return tool.Model.get_booleans(representation=representation)
|
return tool.Model.get_booleans(representation=representation)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def manual_booleans(cls):
|
def manual_booleans(cls) -> list[ifcopenshell.entity_instance]:
|
||||||
props = tool.Geometry.get_geometry_props()
|
obj = tool.Geometry.get_active_or_representation_obj()
|
||||||
obj = props.representation_obj or bpy.context.active_object
|
assert obj
|
||||||
if not (representation := tool.Geometry.get_active_representation(obj)):
|
if not (representation := tool.Geometry.get_active_representation(obj)):
|
||||||
return []
|
return []
|
||||||
return tool.Model.get_manual_booleans(tool.Ifc.get_entity(obj), representation=representation)
|
return tool.Model.get_manual_booleans(tool.Ifc.get_entity(obj), representation=representation)
|
||||||
|
|||||||
Reference in New Issue
Block a user