Fix #6575. Regression in moving aggregates.

This commit is contained in:
Dion Moult
2025-04-19 15:30:46 +10:00
parent bb598d848a
commit fb34af9162
@@ -3071,20 +3071,21 @@ class OverrideMove(bpy.types.Operator):
element = tool.Ifc.get_entity(obj)
if not element or not element.is_a("IfcElement"):
continue
parts = ifcopenshell.util.element.get_parts(element)
if parts:
if parts := ifcopenshell.util.element.get_parts(element):
aggregates_to_move.append(tool.Ifc.get_object(element))
aggregates_to_move.extend(list(tool.Aggregate.get_parts_recursively(element)))
continue
# 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]
aggregate = None
if 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