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();
recreateTabs();
for (let group of Widget.Groups.list()) {
let root = group[0];
if (root.tabs)
for (let tab of Object.values(root.tabs)) {
for (let widget of group) {
if (widget.tabs)
for (let tab of Object.values(widget.tabs)) {
let geo = tab.box.geometry.clone();
if (geo.index) geo = geo.toNonIndexed();
geo.translate(tab.x, tab.y, tab.z);
let bbg = BufferGeometryUtils.mergeGeometries([ geo ]);
let sw = newWidget(null, group);
let fwp = group[0].track.pos;
let fwp = widget.track.pos;
sw.loadGeometry(bbg);
sw._move(fwp.x, fwp.y, fwp.z);
api.widgets.add(sw);
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) {
if (widget.track.synth) return ondone();
// get tab widgets
let tabW = widget.group.filter(w => w != widget);
// get tab widgets for this specific widget
let tabW = widget.group.filter(w => w != widget && w.track.tabOwner === widget.id);
// merge overlapping tabs
for (let i=0; i<tabW.length; i++) {