freealise commited on
Commit
c47b8bc
·
verified ·
1 Parent(s): 5d1153e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -638,16 +638,20 @@ async(c, o, p, d, n, m)=>{
638
  BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].material.diffuseTexture.hasAlpha = true;
639
  BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].material.useAlphaFromDiffuseTexture = true;
640
  BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].applyDisplacementMap(m[o_[j]].url, 0, 255, function(m){try{alert(BABYLON.Engine.Version);}catch(e){alert(e);}}, null, null, true, function(e){alert(e);});
 
 
 
 
641
 
 
642
  const opt = document.createElement("option");
643
  opt.value = j;
644
  opt.innerText = j;
 
 
 
645
  document.getElementById("cnum").appendChild(opt);
646
  }
647
- loadEditControl();
648
- const editControl = new EditControl(BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1], BABYLON.Engine.LastCreatedScene.activeCamera, document.getElementById("model3D").getElementsByTagName("canvas")[0], 1.0, true, 0.02);
649
- editControl.enableTranslation();
650
-
651
  document.getElementById("cnum").onchange = function(e) {
652
  editControl.switchTo(BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1-parseInt(e.target.value)], true);
653
  }
 
638
  BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].material.diffuseTexture.hasAlpha = true;
639
  BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].material.useAlphaFromDiffuseTexture = true;
640
  BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].applyDisplacementMap(m[o_[j]].url, 0, 255, function(m){try{alert(BABYLON.Engine.Version);}catch(e){alert(e);}}, null, null, true, function(e){alert(e);});
641
+ }
642
+ loadEditControl();
643
+ const editControl = new EditControl(BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1], BABYLON.Engine.LastCreatedScene.activeCamera, document.getElementById("model3D").getElementsByTagName("canvas")[0], 1.0, true, 0.02);
644
+ editControl.enableTranslation();
645
 
646
+ for (var j=0; j<o_.length; j++) {
647
  const opt = document.createElement("option");
648
  opt.value = j;
649
  opt.innerText = j;
650
+ if (j==0) {
651
+ opt.selected = true;
652
+ }
653
  document.getElementById("cnum").appendChild(opt);
654
  }
 
 
 
 
655
  document.getElementById("cnum").onchange = function(e) {
656
  editControl.switchTo(BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1-parseInt(e.target.value)], true);
657
  }