From 3874d19caa1435cd2191624f8a2c289c2d3c0334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Perdig=C3=A3o?= Date: Thu, 12 Dec 2024 11:49:22 -0300 Subject: [PATCH] Allow aggregate to me moved while in aggregate mode without moving its parts. --- src/bonsai/bonsai/bim/module/aggregate/decorator.py | 4 +++- src/bonsai/bonsai/tool/aggregate.py | 8 +++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/aggregate/decorator.py b/src/bonsai/bonsai/bim/module/aggregate/decorator.py index be7540eda3..362c5baa4b 100644 --- a/src/bonsai/bonsai/bim/module/aggregate/decorator.py +++ b/src/bonsai/bonsai/bim/module/aggregate/decorator.py @@ -286,9 +286,11 @@ class AggregateModeDecorator: self.line_shader.bind() self.line_shader.uniform_float("viewportSize", (context.region.width, context.region.height)) self.line_shader.uniform_float("lineWidth", 2.0) - color = self.addon_prefs.decorator_color_selected theme = context.preferences.themes.items()[0][1] selected_object_color = (*theme.view_3d.object_active, 1) + color = self.addon_prefs.decorator_color_selected + if aggregate_obj in context.selected_objects: + color = selected_object_color size = aggregate_obj.empty_display_size location = aggregate_obj.location line_x = (location - Vector((size, 0.0, 0.0)), location + Vector((size, 0.0, 0.0))) diff --git a/src/bonsai/bonsai/tool/aggregate.py b/src/bonsai/bonsai/tool/aggregate.py index 3735120368..55cdf57427 100644 --- a/src/bonsai/bonsai/tool/aggregate.py +++ b/src/bonsai/bonsai/tool/aggregate.py @@ -135,11 +135,7 @@ class Aggregate(bonsai.core.tool.Aggregate): objs.append(obj.original) for obj in objs: if obj.original not in parts_objs: - try: - is_element_assembly = tool.Ifc.get_entity(obj.original).is_a("IfcElementAssembly") - except: - is_element_assembly = False - if not obj.data and not is_element_assembly: + if obj == props.editing_aggregate: continue obj.original.display_type = "WIRE" not_editing_obj = props.not_editing_objects.add() @@ -147,6 +143,7 @@ class Aggregate(bonsai.core.tool.Aggregate): else: editing_obj = props.editing_objects.add() editing_obj.obj = obj.original + tool.Aggregate.apply_constraints(obj.original) props.in_aggregate_mode = True return {"FINISHED"} @@ -162,6 +159,7 @@ class Aggregate(bonsai.core.tool.Aggregate): if not element: continue + tool.Aggregate.constrain_parts_to_aggregate(props.editing_aggregate) props.in_aggregate_mode = False props.not_editing_objects.clear() props.editing_objects.clear()