Improve performance in aggregate mode by removing hide_select.

Additionally, update rendering of objects outside the aggregate to use
 'WIRE' instead of 'BOUNDS'.
This commit is contained in:
Bruno Perdigão
2024-11-29 15:37:47 -03:00
committed by Bruno Perdigão
parent 3dd83598e9
commit 833cc0604c
2 changed files with 8 additions and 5 deletions
@@ -99,14 +99,15 @@ class BIMObjectAggregateProperties(PropertyGroup):
) )
class NotEditingObjects(bpy.types.PropertyGroup): class Objects(bpy.types.PropertyGroup):
obj: PointerProperty(type=bpy.types.Object) obj: PointerProperty(type=bpy.types.Object)
class BIMAggregateProperties(PropertyGroup): class BIMAggregateProperties(PropertyGroup):
in_aggregate_mode: BoolProperty(name="In Edit Mode", update=update_aggregate_mode_decorator) in_aggregate_mode: BoolProperty(name="In Edit Mode", update=update_aggregate_mode_decorator)
editing_aggregate: PointerProperty(name="Editing Aggregate", type=bpy.types.Object) editing_aggregate: PointerProperty(name="Editing Aggregate", type=bpy.types.Object)
not_editing_objects: CollectionProperty(type=NotEditingObjects) editing_objects: CollectionProperty(type=Objects)
not_editing_objects: CollectionProperty(type=Objects)
aggregate_decorator: BoolProperty( aggregate_decorator: BoolProperty(
name="Display Aggregate", name="Display Aggregate",
default=False, default=False,
+5 -3
View File
@@ -141,10 +141,12 @@ class Aggregate(bonsai.core.tool.Aggregate):
is_element_assembly = False is_element_assembly = False
if not obj.data and not is_element_assembly: if not obj.data and not is_element_assembly:
continue continue
obj.original.display_type = "BOUNDS" obj.original.display_type = "WIRE"
obj.hide_select = True
not_editing_obj = props.not_editing_objects.add() not_editing_obj = props.not_editing_objects.add()
not_editing_obj.obj = obj.original not_editing_obj.obj = obj.original
else:
editing_obj = props.editing_objects.add()
editing_obj.obj = obj.original
props.in_aggregate_mode = True props.in_aggregate_mode = True
return {"FINISHED"} return {"FINISHED"}
@@ -156,10 +158,10 @@ class Aggregate(bonsai.core.tool.Aggregate):
objs = [o.obj for o in props.not_editing_objects] objs = [o.obj for o in props.not_editing_objects]
for obj in objs: for obj in objs:
obj.original.display_type = "TEXTURED" obj.original.display_type = "TEXTURED"
obj.hide_select = False
element = tool.Ifc.get_entity(obj) element = tool.Ifc.get_entity(obj)
if not element: if not element:
continue continue
props.in_aggregate_mode = False props.in_aggregate_mode = False
props.not_editing_objects.clear() props.not_editing_objects.clear()
props.editing_objects.clear()