freealise commited on
Commit
324c1d2
1 Parent(s): c63285a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -556,6 +556,7 @@ def draw_mask(l, t, v, d, evt: gr.EventData):
556
  mask = mask[1:mask.shape[0]-1, 1:mask.shape[1]-1]
557
 
558
  d["layers"][0][mask>0] = (255,255,255,255)
 
559
  #d["background"][mask>0] = (255,255,255,255)
560
 
561
  return gr.ImageEditor(value=d)
@@ -639,6 +640,7 @@ async(c, o, b, p, d, n, m)=>{
639
  let mesh = q[i];
640
  mesh.dispose(false, true);
641
  }
 
642
  BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].scaling.z = -1;
643
  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);});
644
  BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].material.diffuseTexture.hasAlpha = true;
 
556
  mask = mask[1:mask.shape[0]-1, 1:mask.shape[1]-1]
557
 
558
  d["layers"][0][mask>0] = (255,255,255,255)
559
+ d["layers"][0][mask==0] = (0,0,0,0)
560
  #d["background"][mask>0] = (255,255,255,255)
561
 
562
  return gr.ImageEditor(value=d)
 
640
  let mesh = q[i];
641
  mesh.dispose(false, true);
642
  }
643
+ BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].alphaIndex = o_.length-j;
644
  BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].scaling.z = -1;
645
  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);});
646
  BABYLON.Engine.LastCreatedScene.meshes[BABYLON.Engine.LastCreatedScene.meshes.length-1].material.diffuseTexture.hasAlpha = true;