Commit Graph

15 Commits

Author SHA1 Message Date
Petru Conduraru 99b2aef1bd Fix #6663: keep a duplicated nested aggregate inside its parent aggregate
Duplicating a linked aggregate (Ctrl+Shift+D) that is itself nested inside
another aggregate dropped the copy outside its parent instead of keeping
it nested.

Root cause: DuplicateMoveLinkedAggregate.execute_ifc_duplicate_linked_aggregate_operator
called tool.Root.recreate_aggregate(old_to_new) a second time, after
execute_ifc_duplicate_operator had already called it once (via
duplicate_ifc_objects) and, for the case where the parent aggregate itself
was not part of the duplication set, had already correctly restored the
new nested aggregate's assignment to that original parent. On the second,
redundant call, recreate_aggregate looks up the parent aggregate in
old_to_new again, still does not find it there (since the parent was
never duplicated), and its "parent not found" branch actively unassigns
the just-restored link, stranding the duplicate outside its parent.

Fix: drop the redundant second call. The plain duplicate path already
handles both cases correctly (parent duplicated and parent not duplicated).

Verified live in headless Blender 5.2 / Bonsai on the repo's own
test/files/linked-aggregates.ifc: nested Wall_01/Wall_02 wrapped into a
new aggregate "Nested" inside the existing "Assembly" aggregate, then
duplicated via bim.object_duplicate_move_linked_aggregate. Before the fix,
the new "Nested_01" aggregate had no parent aggregate; after the fix it
correctly remains aggregated by "Assembly". Also added a regression
scenario to test/bim/feature/geometry.feature covering this exact case,
manually traced against the existing step definitions (the full
pytest-bdd harness needs a network-provisioned Blender python to run
locally, so it hasn't been executed through pytest itself; CI will run
it). black + ruff clean.

Generated with the assistance of an AI coding tool.
2026-07-16 14:50:41 +03:00
Gorgious56 1b2507e143 Fix 8077 : Fix SHIFT + D with non-ifc object selection
When a project has a ifc file associated, selecting non-ifc objects and duplicating them with SHIFT + D now correctly both duplicate them, keep the new objects selected and starts the transform modal. IFC objects behaviour is unaffected.
2026-05-19 12:29:18 +02:00
Andrej730 a7c8c908fe Fix left out invalid mesh data blocks and fix failing geom core test (after fcee54c) 2025-11-17 16:30:28 +05:00
Andrej730 fb902a04f5 test_feature - use common prompts for loading/saving temp projects 2025-11-17 16:30:24 +05:00
Andrej730 f643a1615e Fix failing aggregate duplication test after 17d6b8a 2025-11-11 19:56:55 +05:00
Andrej730 71e78c67f8 Add visibility and lock steps to geometry.feature
Added steps to set 'is_visible' to TRUE and 'is_locked' to FALSE in the 'Spatial Decomposition' panel for the 'Override paste buffer - with active IFC data' scenario. This ensures the test covers visibility and lock state handling for IFC objects.
2025-11-11 19:56:55 +05:00
Andrej730 6c31d43e72 Fix feature tests after a11f81f 2025-11-11 19:56:54 +05:00
Andrej730 68cf8ee247 BIM tests - replace some class assignment with PanelSpy version 2025-04-03 18:06:48 +05:00
Dion Moult acdc40fb41 See #1227. Reimplement extending walls to another wall 2025-03-12 23:05:34 +11:00
Dion Moult 823f27cd6a Add tests for new element add feature 2025-03-10 22:53:55 +11:00
Dion Moult 2318132ea2 Minor refactor add_constr_type_instance is now add_occurrence 2025-03-10 08:23:56 +11:00
Dion Moult fcee54c572 Fix regression when removing an active representation.
Some tests removed since they no longer make sense with the new item
editing mode.
2025-02-08 00:21:38 +11:00
Dion Moult 889a9e3891 Tweak failing test to now allow assigning elements to scaled multi-user objects
Previously this was not allowed, but I don't see why not
2025-02-08 00:20:25 +11:00
Dion Moult cea4c0c01d Fix #5345. Bug when adding a new representation using "full representation". No temp data is used, so deletion not required. 2024-09-07 14:50:09 +10:00
Dion Moult 25071dfec6 Rename source dir 2024-08-13 23:09:50 +10:00