Why not let users choose the timing of adding Mesh to the scene? Instead, add it to the scene when it is created?
1 Like
Like this?
e.g.
//Fake code
const container=AssetContainers(scene)
const mesh=new Mesh("tt",scene)
scene.remove(scene)
container.push(mesh)
//...
//...
container.addAllToScene()
This should be
scene.remove(mesh)
but basically yes if you are creating your meshes with BabylonJS.
Or you can load your scene into an AssetContainer
like this:
const container = await BABYLON.SceneLoader.LoadAssetContainerAsync(
"https://playgrounds.babylonjs.xyz/", "eifell.glb", scene)
To show the loaded mesh you have to call
container.addAllToScene()
otherwise the mesh will be not displayed.
Here is a PG. It will show a yellow background while downloading the glb. After the download finished the bg will turn to green and after two seconds it will display the mesh.
1 Like
Thanks,i get it
1 Like