fix widget + tab assignment when slicing

This commit is contained in:
Stewart Allen 2026-05-16 14:50:34 -04:00
commit f32af7eeb1
2 changed files with 18 additions and 16 deletions

View file

@ -906,20 +906,22 @@ export function init() {
clearPops(); clearPops();
recreateTabs(); recreateTabs();
for (let group of Widget.Groups.list()) { for (let group of Widget.Groups.list()) {
let root = group[0]; for (let widget of group) {
if (root.tabs) if (widget.tabs)
for (let tab of Object.values(root.tabs)) { for (let tab of Object.values(widget.tabs)) {
let geo = tab.box.geometry.clone(); let geo = tab.box.geometry.clone();
if (geo.index) geo = geo.toNonIndexed(); if (geo.index) geo = geo.toNonIndexed();
geo.translate(tab.x, tab.y, tab.z); geo.translate(tab.x, tab.y, tab.z);
let bbg = BufferGeometryUtils.mergeGeometries([ geo ]); let bbg = BufferGeometryUtils.mergeGeometries([ geo ]);
let sw = newWidget(null, group); let sw = newWidget(null, group);
let fwp = group[0].track.pos; let fwp = widget.track.pos;
sw.loadGeometry(bbg); sw.loadGeometry(bbg);
sw._move(fwp.x, fwp.y, fwp.z); sw._move(fwp.x, fwp.y, fwp.z);
api.widgets.add(sw); api.widgets.add(sw);
sw.track.synth = true; sw.track.synth = true;
sw.track.indexed = root.track.indexed; sw.track.indexed = widget.track.indexed;
sw.track.tabOwner = widget.id;
}
} }
} }
}); });

View file

@ -35,8 +35,8 @@ export function cam_slice_pre(settings) {
export async function cam_slice(settings, widget, onupdate, ondone) { export async function cam_slice(settings, widget, onupdate, ondone) {
if (widget.track.synth) return ondone(); if (widget.track.synth) return ondone();
// get tab widgets // get tab widgets for this specific widget
let tabW = widget.group.filter(w => w != widget); let tabW = widget.group.filter(w => w != widget && w.track.tabOwner === widget.id);
// merge overlapping tabs // merge overlapping tabs
for (let i=0; i<tabW.length; i++) { for (let i=0; i<tabW.length; i++) {