Can we import mesh as an object but do not bind to scene?If we need it,we can do something like call meshObj.appendToScene(scene)
hi @Aze - welcome to the community!!! That is a big ask from me too, but at loader level. Can you get around that with asset containers?
Asset Containers | Babylon.js Documentation (babylonjs.com)
@brianzinn Thanks for your answer.
Assets container does not meet my needs.In some cases,i will preload some resources to speed up scene loading.Then,i will change the scene instance,but i don’t want to reload the resources that i had loaded.
I just want the mesh obj that can append to different scene.Organizational structures are less free now.
Maybe you can explain more your scenario - what you are trying to preload and want to apply to different scenes. If they are textures/geometry/models/etc.
The comment in this thread from JCPalmer may be helpful:
Feature request: add model loading stage - Questions - Babylon.js (babylonjs.com)
I’m sorry for my late reply.It’s been too busy.
The idea that the comment said is similar to mine.I want to preload the mesh then append them to every scene i need.For example,i have two engines and two scenes.I preload the mesh that preprocess by babylon and then i can synchronously append it to these scenes.It can saving time to create scene,but do not need to fetch the mesh file.
My english is poor,sorry for that.
I don’t think that is easily possible.
Once a Model is loaded it is attached to the scene and the AssetContainer is just a way to stash things for a scene. I believe it is not cross-engine and what you are asking is not possible. On the one hand the browser should cache assets, but for pre-loading and saving actual assets then I think the loaders would need another stage or work like they do in three.js.
@sebavan is there a solution here?
It won t be possible accross engines as gl context can not be shared, the only thing possible is to prefectch the network calls.
yes, network prefetch works for single file models/asset. I don’t have a full solution either, since there is no place to capture the entire model and assets before it goes to scene on multi-file.