Update app.py
Browse files
app.py
CHANGED
@@ -577,6 +577,7 @@ async(c, o, p, d, n, m, s)=>{
|
|
577 |
delta = now - then;
|
578 |
then = now - (delta % interval);
|
579 |
if (delta >= interval - tolerance) {
|
|
|
580 |
BABYLON.Engine.LastCreatedScene.render();
|
581 |
}
|
582 |
});
|
@@ -784,6 +785,11 @@ async(c, o, p, d, n, m, s)=>{
|
|
784 |
document.getElementById("model").appendChild(document.getElementById("model3D"));
|
785 |
toggleDisplay("model");
|
786 |
}
|
|
|
|
|
|
|
|
|
|
|
787 |
clearInterval(intv);
|
788 |
}
|
789 |
} catch(e) {alert(e);}
|
@@ -1251,7 +1257,7 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
|
|
1251 |
with gr.Group():
|
1252 |
camera = gr.HTML(value="""<div style='width:128px;height:128px;border:1px dotted gray;padding:0;margin:0;float:left;clear:none;' id='seek'></div>
|
1253 |
<span style='max-width:50%;float:right;clear:none;'>
|
1254 |
-
<a href='#' id='reset_cam' style='float:right;clear:none;color:white' onclick='
|
1255 |
if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
|
1256 |
BABYLON.Engine.LastCreatedScene.activeCamera.metadata = {
|
1257 |
screenshot: true,
|
@@ -1282,6 +1288,16 @@ with gr.Blocks(css=css, js=js, head=head) as demo:
|
|
1282 |
|
1283 |
document.getElementById(\"model3D\").getElementsByTagName(\"canvas\")[0].style.filter = \"blur(\" + BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].material.pointSize/2.0*Math.sqrt(2.0) + \"px)\";
|
1284 |
'/> <span>0.8</span><br/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1285 |
<label for='contrast' style='width:8em'>Contrast</label><input id='contrast' type='range' style='width:128px;height:1em;' value='1.0' min='0' max='2' step='0.001' oninput='
|
1286 |
if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
|
1287 |
var evt = document.createEvent(\"Event\");
|
|
|
577 |
delta = now - then;
|
578 |
then = now - (delta % interval);
|
579 |
if (delta >= interval - tolerance) {
|
580 |
+
BABYLON.Engine.LastCreatedScene.activeCamera.target = BABYLON.Engine.LastCreatedScene.activeCamera.getDirection(BABYLON.Engine.LastCreatedScene.activeCamera.rotation);
|
581 |
BABYLON.Engine.LastCreatedScene.render();
|
582 |
}
|
583 |
});
|
|
|
785 |
document.getElementById("model").appendChild(document.getElementById("model3D"));
|
786 |
toggleDisplay("model");
|
787 |
}
|
788 |
+
var code = document.getElementsByTagName('script');
|
789 |
+
for (var i=0; i<code.length; i++) {
|
790 |
+
alert(code[i].innerText);
|
791 |
+
}
|
792 |
+
|
793 |
clearInterval(intv);
|
794 |
}
|
795 |
} catch(e) {alert(e);}
|
|
|
1257 |
with gr.Group():
|
1258 |
camera = gr.HTML(value="""<div style='width:128px;height:128px;border:1px dotted gray;padding:0;margin:0;float:left;clear:none;' id='seek'></div>
|
1259 |
<span style='max-width:50%;float:right;clear:none;'>
|
1260 |
+
<a href='#' id='reset_cam' style='text-align:right;float:right;clear:none;color:white' onclick='
|
1261 |
if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
|
1262 |
BABYLON.Engine.LastCreatedScene.activeCamera.metadata = {
|
1263 |
screenshot: true,
|
|
|
1288 |
|
1289 |
document.getElementById(\"model3D\").getElementsByTagName(\"canvas\")[0].style.filter = \"blur(\" + BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].material.pointSize/2.0*Math.sqrt(2.0) + \"px)\";
|
1290 |
'/> <span>0.8</span><br/>
|
1291 |
+
<label for='pan' style='width:8em'>Pan</label><input id='pan' type='range' style='width:128px;height:1em;' value='0' min='-16' max='16' step='0.001' oninput='
|
1292 |
+
if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
|
1293 |
+
var evt = document.createEvent(\"Event\");
|
1294 |
+
evt.initEvent(\"click\", true, false);
|
1295 |
+
document.getElementById(\"reset_cam\").dispatchEvent(evt);
|
1296 |
+
}
|
1297 |
+
BABYLON.Engine.LastCreatedScene.activeCamera.rotation.x = this.value;
|
1298 |
+
BABYLON.Engine.LastCreatedScene.activeCamera.target = BABYLON.Engine.LastCreatedScene.activeCamera.getDirection(BABYLON.Engine.LastCreatedScene.activeCamera.rotation);
|
1299 |
+
this.parentNode.childNodes[2].innerText = BABYLON.Engine.LastCreatedScene.activeCamera.rotation.x;
|
1300 |
+
'/> <span>0.0</span><br/>
|
1301 |
<label for='contrast' style='width:8em'>Contrast</label><input id='contrast' type='range' style='width:128px;height:1em;' value='1.0' min='0' max='2' step='0.001' oninput='
|
1302 |
if (!BABYLON.Engine.LastCreatedScene.activeCamera.metadata) {
|
1303 |
var evt = document.createEvent(\"Event\");
|