Ready for first beta [ci-build]

Fix pasting a group does not select it
Wrapping non-renamed elements (cubes and meshes) into a group no longer names group after them
This commit is contained in:
JannisX11 2024-04-18 20:17:49 +02:00
parent 17b04c793c
commit cd44f3be21
2 changed files with 9 additions and 6 deletions

View File

@ -331,7 +331,7 @@ const Clipbench = {
if (Clipbench.group) {
function iterate(obj, parent) {
if (obj.children) {
var copy = new Group(obj).addTo(parent).init();
let copy = new Group(obj).addTo(parent).init();
copy._original_name = copy.name;
copy.createUniqueName();
Property.resetUniqueValues(Group, copy);
@ -341,15 +341,17 @@ const Clipbench = {
iterate(child, copy)
})
}
return copy;
} else if (OutlinerElement.isTypePermitted(obj.type)) {
var copy = OutlinerElement.fromSave(obj).addTo(parent).selectLow();
copy.createUniqueName();
Property.resetUniqueValues(copy.constructor, copy);
copy.preview_controller.updateTransform(copy);
return copy;
}
}
iterate(Clipbench.group, target)
updateSelection()
let copy = iterate(Clipbench.group, target);
copy.select();
} else if (Clipbench.elements && Clipbench.elements.length) {
let elements = [];

View File

@ -579,13 +579,14 @@ BARS.defineActions(function() {
keybind: new Keybind({key: 'g', ctrl: true, shift: true}),
click: function () {
Undo.initEdit({outliner: true});
var add_group = Group.selected
let add_group = Group.selected
if (!add_group && Outliner.selected.length) {
add_group = Outliner.selected.last()
}
var base_group = new Group({
let new_name = add_group?.name;
let base_group = new Group({
origin: add_group ? add_group.origin : undefined,
name: add_group?.name
name: ['cube', 'mesh'].includes(new_name) ? undefined : new_name
})
base_group.sortInBefore(add_group);
base_group.isOpen = true