See #6537. Fix how OverrideMove works when dealing with multiple levels of aggregates.

This commit is contained in:
Bruno Perdigão
2025-04-16 20:46:39 -03:00
parent c9fc543e91
commit c45e3b0099
@@ -3299,9 +3299,17 @@ class OverrideMove(bpy.types.Operator):
if parts:
aggregates_to_move.append(tool.Ifc.get_object(element))
aggregates_to_move.extend(list(tool.Aggregate.get_parts_recursively(element)))
continue
aggregate = ifcopenshell.util.element.get_aggregate(element)
# Controls the aggregate level it should consider to move
aggregates = tool.Aggregate.get_aggregates_recursively(element)
aggregate = aggregates[-1]
if props.in_aggregate_mode:
current_aggregate_index = aggregates.index(tool.Ifc.get_entity(props.editing_aggregate))
aggregate = aggregates[current_aggregate_index - 1]
if tool.Ifc.get_entity(props.editing_aggregate) == aggregates[0]:
aggregate = aggregates[0]
if not parts and props.in_aggregate_mode and aggregate == tool.Ifc.get_entity(props.editing_aggregate):
continue
if aggregate: