so I am trying to use houdini update the same obj file, in the meantime update the mesh :
engine.runRenderLoop(){
BABYLON.SceneLoader.ImportMeshAsync("", “model/”,“MyBox.obj”, scene,function(newScene){});
}
I can see Babylon try to load a new mesh(same name and same place) all the time
but it still keep the old one(which doesn’t exist anymore) unless I refresh my web I will always see my old mesh in the scene
and every time the users finish the drawing will refresh the <map.obj>, then upload that to
Babylon canvas, I overwrite the old obj file, that’s why I say it doesn’t exist anymore, which lead to your third question, there is only on obj file, but when I use the old mesh still exist in the Babylon canvas and I can see the new mesh has been successfully loaded as well
so I have map1 in canvas, I change the obj auto-update I get map2 but 1 is still there, then I did another change map3 is in, but 1 and 2 still there. Until I hit the refresh button those ‘ghost’ will always be there…
Overwriting the old object does not mean babylon got rid of it. ImportMesh(async) does not create a new scene (as you might think, due to your variable naming in your question), it adds meshes to the existing scene you are already using.
Keep a reference to the old mesh that was created and dispose it in the importmeshasync callback. This way you will see the new mesh and not the old one. I hope this will solve your problem