Skip to content

Commit

Permalink
Fix #2629 undoing group duplication creates broken objects
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisX11 committed Jan 7, 2025
1 parent 5cbccc9 commit 787cdd6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/outliner/outliner.js
Original file line number Diff line number Diff line change
Expand Up @@ -1067,12 +1067,16 @@ SharedActions.add('duplicate', {
}

let all_new = [];
for (let group of Group.multi_selected) {
let old_selected_groups = Group.multi_selected.slice();
Group.multi_selected.empty();
for (let group of old_selected_groups) {
group.selected = false;
let new_group = group.duplicate();
new_group.forEachChild(g => all_new.push(g), Group, true);
new_group.multiSelect();
}
new_group.multiSelect();

updateSelection();
Undo.finishEdit('Duplicate group', {outliner: true, elements: elements.slice().slice(cubes_before), selection: true});

if (Animation.all.length) {
Expand Down

0 comments on commit 787cdd6

Please # to comment.