part 2
This commit is contained in:
parent
0c7211846f
commit
eb85ab002c
2 changed files with 7 additions and 12 deletions
|
|
@ -47,6 +47,7 @@ kiri.load(() => {
|
||||||
$('layer-animate').innerHTML = '';
|
$('layer-animate').innerHTML = '';
|
||||||
$('layer-toolpos').innerHTML = '';
|
$('layer-toolpos').innerHTML = '';
|
||||||
Object.keys(meshes).forEach(id => deleteMesh(id));
|
Object.keys(meshes).forEach(id => deleteMesh(id));
|
||||||
|
toggleStock(undefined,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function animate(api, delay) {
|
function animate(api, delay) {
|
||||||
|
|
@ -69,7 +70,7 @@ kiri.load(() => {
|
||||||
speedLabel = UC.newLabel("speed", {class:"speed padleft"}),
|
speedLabel = UC.newLabel("speed", {class:"speed padleft"}),
|
||||||
progress = UC.newLabel('0%', {class:"progress"}),
|
progress = UC.newLabel('0%', {class:"progress"}),
|
||||||
modelButton = UC.newButton(null,toggleModel,{icon:'<i class="fa-solid fa-eye"></i>',title:"show model",class:"padleft"}),
|
modelButton = UC.newButton(null,toggleModel,{icon:'<i class="fa-solid fa-eye"></i>',title:"show model",class:"padleft"}),
|
||||||
shadeButton = UC.newButton(null,toggleShade,{icon:'<i class="fa-solid fa-cube"></i>',title:"stock box"}),
|
shadeButton = UC.newButton(null,toggleStock,{icon:'<i class="fa-solid fa-cube"></i>',title:"stock box"}),
|
||||||
]);
|
]);
|
||||||
updateSpeed();
|
updateSpeed();
|
||||||
setTimeout(step, delay || 0);
|
setTimeout(step, delay || 0);
|
||||||
|
|
@ -82,7 +83,7 @@ kiri.load(() => {
|
||||||
api.alerts.hide(alert);
|
api.alerts.hide(alert);
|
||||||
moto.space.platform.showGridBelow(false);
|
moto.space.platform.showGridBelow(false);
|
||||||
toggleModel();
|
toggleModel();
|
||||||
toggleShade();
|
toggleStock();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -177,14 +178,8 @@ kiri.load(() => {
|
||||||
api.widgets.all().forEach(w => w.toggleVisibility());
|
api.widgets.all().forEach(w => w.toggleVisibility());
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleShade() {
|
function toggleStock(ev,bool) {
|
||||||
return api.event.emit('cam.stock.toggle');
|
return api.event.emit('cam.stock.toggle', bool ?? undefined);
|
||||||
material.transparent = !material.transparent;
|
|
||||||
if (material.transparent) {
|
|
||||||
material.color.addScalar(0.07);
|
|
||||||
} else {
|
|
||||||
material.color.addScalar(-0.07);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function step() {
|
function step() {
|
||||||
|
|
|
||||||
|
|
@ -234,8 +234,8 @@ CAM.init = function(kiri, api) {
|
||||||
updateAxisMode();
|
updateAxisMode();
|
||||||
});
|
});
|
||||||
|
|
||||||
api.event.on("cam.stock.toggle", () => {
|
api.event.on("cam.stock.toggle", (bool) => {
|
||||||
camStock.visible = !camStock.visible;
|
camStock && (camStock.visible = bool ?? !camStock.visible);
|
||||||
});
|
});
|
||||||
|
|
||||||
api.event.on("boolean.click", api.platform.update_bounds);
|
api.event.on("boolean.click", api.platform.update_bounds);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue