Going in and out of AGGREGATE mode doesn't overwrite other objects' display type anymore

This commit is contained in:
Gorgious56
2025-01-08 16:53:59 +01:00
parent d4ff789688
commit 2d5bc49ee0
2 changed files with 6 additions and 4 deletions
@@ -101,6 +101,7 @@ class BIMObjectAggregateProperties(PropertyGroup):
class Objects(bpy.types.PropertyGroup):
obj: PointerProperty(type=bpy.types.Object)
previous_display_type: bpy.props.StringProperty(default="TEXTURED")
class BIMAggregateProperties(PropertyGroup):
+5 -4
View File
@@ -174,9 +174,10 @@ class Aggregate(bonsai.core.tool.Aggregate):
if obj.original not in parts_objs:
if obj == props.editing_aggregate:
continue
obj.original.display_type = "WIRE"
not_editing_obj = props.not_editing_objects.add()
not_editing_obj.obj = obj.original
not_editing_obj.previous_display_type = obj.original.display_type
obj.original.display_type = "WIRE"
else:
editing_obj = props.editing_objects.add()
editing_obj.obj = obj.original
@@ -190,9 +191,9 @@ class Aggregate(bonsai.core.tool.Aggregate):
def disable_aggregate_mode(cls):
context = bpy.context
props = context.scene.BIMAggregateProperties
objs = [o.obj for o in props.not_editing_objects]
for obj in objs:
obj.original.display_type = "TEXTURED"
for obj_prop in props.not_editing_objects:
obj = obj_prop.obj
obj.original.display_type = obj_prop.previous_display_type
element = tool.Ifc.get_entity(obj)
if not element:
continue