mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-21 01:13:37 +08:00
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:
parent
17b04c793c
commit
cd44f3be21
@ -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 = [];
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user