cam: filter synth in prepare bc tab update. fix first save move between widgets

This commit is contained in:
Stewart Allen 2025-11-27 12:40:27 -05:00
commit 7befba7040
3 changed files with 7 additions and 2 deletions

View file

@ -332,6 +332,10 @@ class Widget {
moto.space.refresh();
}
isSynth() {
return this.track.synth ?? false;
}
isVisible() {
return this.getMaterial().visible;
}

View file

@ -810,6 +810,7 @@ export function init() {
clearPops();
for (let group of Widget.Groups.list()) {
let root = group[0];
if (root.tabs)
for (let tab of Object.values(root.tabs)) {
let geo = tab.box.geometry.clone();
if (geo.index) geo = geo.toNonIndexed();

View file

@ -26,7 +26,7 @@ export async function cam_prepare(widall, settings, update) {
print.output = [];
let point;
widgets.forEach((widget, index) => {
widgets.filter(w => !w.isSynth()).forEach((widget, index) => {
point = prepEach(widget, settings, print, point, (progress, msg) => {
update((index * weight + progress * weight) * 0.75, msg || "prepare");
});
@ -337,7 +337,7 @@ export function prepEach(widget, settings, print, firstPoint, update) {
// 1. move to safe z of current point preserving angle
// 2. move to safe z of new point preserving old angle
// 3. move to safe z of new point with new angle
if (lop && lop !== currentOp && lastPoint) {
if (lop !== currentOp && lastPoint) {
// compensate for applyWidgetMovement() applied to lastPoint
let lpo = lastPoint.clone().move({ x: -wmx, y: -wmy, z: -zadd });
camOut(lpo.clone().setZ(zsafe).setA(lastPoint.a), 0);