only remove subsequent anchors in multi-material mode

This commit is contained in:
Stewart Allen 2021-11-30 21:52:48 -05:00
commit 3375a12d35

View file

@ -103,7 +103,18 @@
}); });
// ignore first widget // ignore first widget
widgets.shift(); widgets.shift();
// remove anchor slices from other widgets // count extruders used
let ext = [];
for (let w of widgets) {
if (w.anno && w.anno.extruder >= 0) {
let e = w.anno.extruder;
if (ext.indexOf(e) < 0) {
ext.push(e);
}
}
}
// remove anchor slices from other widgets (only with multi-material)
if (ext.length > 1)
for (let w of widgets) { for (let w of widgets) {
w.slices = w.slices.filter(s => s.index >= 0); w.slices = w.slices.filter(s => s.index >= 0);
} }