stub in placeholder for fdm animation
This commit is contained in:
parent
962ac81865
commit
f30865c60a
4 changed files with 26 additions and 3 deletions
|
|
@ -287,7 +287,7 @@
|
||||||
slice: prepareSlices,
|
slice: prepareSlices,
|
||||||
print: preparePreview,
|
print: preparePreview,
|
||||||
prepare: preparePreview,
|
prepare: preparePreview,
|
||||||
animate: noop,
|
animate: prepareAnimation,
|
||||||
export: prepareExport,
|
export: prepareExport,
|
||||||
cancel: cancelWorker,
|
cancel: cancelWorker,
|
||||||
clear: KIRI.client.clear,
|
clear: KIRI.client.clear,
|
||||||
|
|
@ -1221,6 +1221,10 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function prepareAnimation() {
|
||||||
|
API.event.emit("function.animate", {mode: settings.mode});
|
||||||
|
}
|
||||||
|
|
||||||
function prepareExport() {
|
function prepareExport() {
|
||||||
const argsave = arguments;
|
const argsave = arguments;
|
||||||
if (!complete.preview) {
|
if (!complete.preview) {
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
setLastFraction(frac = 1) {
|
setLastFraction(frac = 1) {
|
||||||
|
if (this.lastVis)
|
||||||
for (let mesh of this.lastVis.children) {
|
for (let mesh of this.lastVis.children) {
|
||||||
let geo = mesh.geometry;
|
let geo = mesh.geometry;
|
||||||
let pos = geo.attributes.position;
|
let pos = geo.attributes.position;
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
API = api;
|
API = api;
|
||||||
|
|
||||||
// wire up animate button in ui
|
// wire up animate button in ui
|
||||||
api.function.animate = () => {
|
api.event.on("function.animate", (mode) => {
|
||||||
if (isCamMode && !camStock) {
|
if (isCamMode && !camStock) {
|
||||||
return api.show.alert("animation requires stock to be enabled");
|
return api.show.alert("animation requires stock to be enabled");
|
||||||
}
|
}
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
animate();
|
animate();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
});
|
||||||
|
|
||||||
api.event.on("mode.set", (mode) => {
|
api.event.on("mode.set", (mode) => {
|
||||||
isCamMode = mode === 'CAM';
|
isCamMode = mode === 'CAM';
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,24 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
api.event.on("function.animate", (mode) => {
|
||||||
|
if (!isFdmMode) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!API.conf.get().controller.danger) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let pct = 0;
|
||||||
|
let int = setInterval(function() {
|
||||||
|
if (pct <= 1) {
|
||||||
|
api.const.STACKS.setFraction(pct);
|
||||||
|
pct += 0.05;
|
||||||
|
} else {
|
||||||
|
api.const.STACKS.setFraction(1);
|
||||||
|
clearTimeout(int);
|
||||||
|
}
|
||||||
|
}, 50);
|
||||||
|
});
|
||||||
api.event.on("mode.set", mode => {
|
api.event.on("mode.set", mode => {
|
||||||
isFdmMode = mode === 'FDM';
|
isFdmMode = mode === 'FDM';
|
||||||
lastMode = mode;
|
lastMode = mode;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue