limit selection matrix mod ops to groups. will require ungrouping to move single parts

This commit is contained in:
Stewart Allen 2022-01-11 21:52:49 -05:00
commit d3a6532bdb

View file

@ -139,28 +139,28 @@ let selection = {
}, },
move(dx = 0, dy = 0, dz = 0) { move(dx = 0, dy = 0, dz = 0) {
for (let s of selected) { for (let s of selection.groups()) {
s.move(dx, dy, dz); s.move(dx, dy, dz);
} }
return selection; return selection;
}, },
rotate(dx = 0, dy = 0, dz = 0) { rotate(dx = 0, dy = 0, dz = 0) {
for (let s of selected) { for (let s of selection.groups()) {
s.rotate(dx, dy, dz); s.rotate(dx, dy, dz);
} }
return selection; return selection;
}, },
qrotate(q) { qrotate(q) {
for (let s of selected) { for (let s of selection.groups()) {
s.qrotate(q); s.qrotate(q);
} }
return selection; return selection;
}, },
scale(dx = 0, dy = 0, dz = 0) { scale(dx = 0, dy = 0, dz = 0) {
for (let s of selected) { for (let s of selection.groups()) {
let { x, y, z } = s.scale(); let { x, y, z } = s.scale();
s.scale(x * dx, y * dy, z * dz); s.scale(x * dx, y * dy, z * dz);
} }
@ -168,14 +168,14 @@ let selection = {
}, },
floor() { floor() {
for (let s of selected) { for (let s of selection.groups()) {
s.floor(...arguments); s.floor(...arguments);
} }
return selection; return selection;
}, },
centerXY() { centerXY() {
for (let s of selected) { for (let s of selection.groups()) {
s.centerXY(...arguments); s.centerXY(...arguments);
} }
return selection; return selection;
@ -311,7 +311,9 @@ let tool = {
promises.push(p); promises.push(p);
} }
Promise.all(promises).then(() => { Promise.all(promises).then(() => {
if (newmdl.length) {
mesh.api.group.new(newmdl, undefined, "patch"); mesh.api.group.new(newmdl, undefined, "patch");
}
api.log.emit('analysis complete').unpin(); api.log.emit('analysis complete').unpin();
}); });
}, },