freealise commited on
Commit
d65dffb
1 Parent(s): 6cb5ade

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -2
app.py CHANGED
@@ -606,7 +606,23 @@ with gr.Blocks(css=css) as demo:
606
  with gr.Accordion(label="Blur levels", open=False):
607
  blur_in = gr.Textbox(label="Kernel size", show_label=False, value="1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1")
608
  with gr.Accordion(label="Locations", open=False):
609
- offset = gr.HTML(value="""<input type='text' id='kbrd' onkeydown='
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
610
  if (BABYLON) {
611
  if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
612
  var evt = document.createEvent(\"Event\");
@@ -712,7 +728,7 @@ with gr.Blocks(css=css) as demo:
712
  this.value = \"\";
713
  }
714
  }
715
- ' style='color:auto;background-color:transparent;border:1px solid lightgray;'/><pre id='keymap'>
716
  ` 1 2 3 4 5 6 7 8 9 0 - =
717
  W E T Y I O { }
718
  A-`S´-D F-`G´-H J-`K´-L ; '
 
606
  with gr.Accordion(label="Blur levels", open=False):
607
  blur_in = gr.Textbox(label="Kernel size", show_label=False, value="1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1")
608
  with gr.Accordion(label="Locations", open=False):
609
+ offset = gr.HTML(value="""<input type='text' id='kbrd' onpointerdown='this.style.color = \"white\";' onpointerup='this.style.color = \"auto\";' onpointermove='
610
+ try {
611
+ if (this.style.color!=\"auto\" && BABYLON) {
612
+ if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
613
+ var evt = document.createEvent(\"Event\");
614
+ evt.initEvent(\"click\", true, false);
615
+ document.getElementById(\"reset_cam\").dispatchEvent(evt);
616
+ }
617
+ event.preventDefault();
618
+ if (BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotationQuaternion) {
619
+ BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotationQuaternion = null;
620
+ }
621
+ BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.z = event.clientX-this.getBoundingClientRect().x-64;
622
+ BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.y = event.clientY-this.getBoundingClientRect().y-64;
623
+ }
624
+ } catch(e) {alert(e)}
625
+ ' onkeydown='
626
  if (BABYLON) {
627
  if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
628
  var evt = document.createEvent(\"Event\");
 
728
  this.value = \"\";
729
  }
730
  }
731
+ ' style='height:128px;width:128px;user-select:none;color:auto;background-color:transparent;border:1px solid gray;'/><pre id='keymap'>
732
  ` 1 2 3 4 5 6 7 8 9 0 - =
733
  W E T Y I O { }
734
  A-`S´-D F-`G´-H J-`K´-L ; '