freealise commited on
Commit
a88fb44
1 Parent(s): b940585

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -605,22 +605,24 @@ async(c, o, b, p, d, n, m)=>{
605
 
606
  if (o == "") {o += n;}
607
  var o_ = o.split(",");
 
608
  for (var j=0; j<o_.length; j++) {
609
  o_[j] = parseInt(o_[j]);
610
- var dome = new BABYLON.PhotoDome("dome", p[o_[j]].image.url,
611
  {
612
  resolution: 16,
613
  size: 512
614
  }, BABYLON.Engine.LastCreatedScene);
615
- for(i = 0; i < BABYLON.Engine.LastCreatedScene.getMeshByName("dome_mesh")._children.length; i++) {
616
- let mesh = BABYLON.Engine.LastCreatedScene.getMeshByName("dome_mesh")._children[i];
 
617
  mesh.dispose(false, true);
618
  }
619
- BABYLON.Engine.LastCreatedScene.getMeshByName("dome_mesh").scaling.z = -1;
620
  if (o_[j] == n) {
621
- BABYLON.Engine.LastCreatedScene.getMeshByName("dome_mesh").applyDisplacementMap(d.background.url, 0, 255, function(m){try{alert(BABYLON.Engine.Version);}catch(e){alert(e);}}, null, null, true, function(e){alert(e);});
622
  } else {
623
- BABYLON.Engine.LastCreatedScene.getMeshByName("dome_mesh").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);});
624
  }
625
  }
626
  clearInterval(intv);
 
605
 
606
  if (o == "") {o += n;}
607
  var o_ = o.split(",");
608
+ var dome = [];
609
  for (var j=0; j<o_.length; j++) {
610
  o_[j] = parseInt(o_[j]);
611
+ dome[j] = new BABYLON.PhotoDome("dome"+j, p[o_[j]].image.url,
612
  {
613
  resolution: 16,
614
  size: 512
615
  }, BABYLON.Engine.LastCreatedScene);
616
+ var q = BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-2]._children;
617
+ for(i = 0; i < q.length; i++) {
618
+ let mesh = q[i];
619
  mesh.dispose(false, true);
620
  }
621
+ BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].scaling.z = -1;
622
  if (o_[j] == n) {
623
+ BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].applyDisplacementMap(d.background.url, 0, 255, function(m){try{alert(BABYLON.Engine.Version);}catch(e){alert(e);}}, null, null, true, function(e){alert(e);});
624
  } else {
625
+ 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);});
626
  }
627
  }
628
  clearInterval(intv);