move animate button generation to the right spot
This commit is contained in:
parent
fb603a53e5
commit
214fcec348
1 changed files with 5 additions and 4 deletions
|
|
@ -140,15 +140,13 @@
|
||||||
|
|
||||||
api.event.on("preview.end", () => {
|
api.event.on("preview.end", () => {
|
||||||
isParsed = false;
|
isParsed = false;
|
||||||
if (isCamMode && camStock) {
|
|
||||||
STACKS.getStack("bounds").button("animate", animate);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
api.event.on("code.loaded", (info) => {
|
api.event.on("code.loaded", (info) => {
|
||||||
if (isCamMode && camStock) {
|
if (isCamMode && camStock) {
|
||||||
isParsed = true;
|
isParsed = true;
|
||||||
STACKS.getStack("parse", SPACE.world).button("animate", animate);
|
let parse = STACKS.getStack("parse", SPACE.world);
|
||||||
|
if (parse) parse.button("animate", animate);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -1255,6 +1253,9 @@
|
||||||
if (x && y && z && !STACKS.getStack('bounds')) {
|
if (x && y && z && !STACKS.getStack('bounds')) {
|
||||||
const render = new KIRI.Layers().setLayer('bounds', { face: 0xaaaaaa, line: 0xaaaaaa });
|
const render = new KIRI.Layers().setLayer('bounds', { face: 0xaaaaaa, line: 0xaaaaaa });
|
||||||
const stack = STACKS.setFreeMem(false).create('bounds', SPACE.world);
|
const stack = STACKS.setFreeMem(false).create('bounds', SPACE.world);
|
||||||
|
if (isCamMode && camStock) {
|
||||||
|
stack.button("animate", animate);
|
||||||
|
}
|
||||||
stack.add(render.addPolys([
|
stack.add(render.addPolys([
|
||||||
newPolygon().centerRectangle({x:csox, y:csoy, z:0}, x, y),
|
newPolygon().centerRectangle({x:csox, y:csoy, z:0}, x, y),
|
||||||
newPolygon().centerRectangle({x:csox, y:csoy, z}, x, y)
|
newPolygon().centerRectangle({x:csox, y:csoy, z}, x, y)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue