Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -452,6 +452,9 @@ with gr.Blocks(css=css) as demo:
|
|
452 |
with gr.Accordion(label="Locations", open=False):
|
453 |
offset = gr.HTML(value="""<input type='text' id='kbrd' onkeydown='
|
454 |
event.preventDefault();
|
|
|
|
|
|
|
455 |
switch(event.key) {
|
456 |
case \"w\":
|
457 |
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.y += 1;
|
@@ -500,27 +503,27 @@ with gr.Blocks(css=css) as demo:
|
|
500 |
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotation.z = 0;
|
501 |
break;
|
502 |
case \"i\":
|
503 |
-
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].
|
504 |
break;
|
505 |
case \",\":
|
506 |
-
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].
|
507 |
break;
|
508 |
case \"j\":
|
509 |
-
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].
|
510 |
break;
|
511 |
case \"l\":
|
512 |
-
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].
|
513 |
break;
|
514 |
case \"o\":
|
515 |
-
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].
|
516 |
break;
|
517 |
case \"m\":
|
518 |
-
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].
|
519 |
break;
|
520 |
case \"k\":
|
521 |
-
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].
|
522 |
-
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].
|
523 |
-
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].
|
524 |
break;
|
525 |
default:
|
526 |
// code block
|
|
|
452 |
with gr.Accordion(label="Locations", open=False):
|
453 |
offset = gr.HTML(value="""<input type='text' id='kbrd' onkeydown='
|
454 |
event.preventDefault();
|
455 |
+
if (BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotationQuaternion) {
|
456 |
+
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotationQuaternion = null;
|
457 |
+
}
|
458 |
switch(event.key) {
|
459 |
case \"w\":
|
460 |
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.y += 1;
|
|
|
503 |
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotation.z = 0;
|
504 |
break;
|
505 |
case \"i\":
|
506 |
+
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].scaling.y += 1;
|
507 |
break;
|
508 |
case \",\":
|
509 |
+
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].scaling.y -= 1;
|
510 |
break;
|
511 |
case \"j\":
|
512 |
+
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].scaling.z -= 1;
|
513 |
break;
|
514 |
case \"l\":
|
515 |
+
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].scaling.z += 1;
|
516 |
break;
|
517 |
case \"o\":
|
518 |
+
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].scaling.x -= 1;
|
519 |
break;
|
520 |
case \"m\":
|
521 |
+
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].scaling.x += 1;
|
522 |
break;
|
523 |
case \"k\":
|
524 |
+
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].scaling.x = 1;
|
525 |
+
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].scaling.y = 1;
|
526 |
+
BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].scaling.z = 1;
|
527 |
break;
|
528 |
default:
|
529 |
// code block
|