Add "cloneModelsToScene" Method to AssetContainer Class

I was wondering if it would be possible to add a new method to the AssetContainer class in Babylon.js that allows models to be cloned to another scene. Currently, we can clone individual meshes using the instantiateModelsToScene method, but there is no built-in way to clone all of the models in an AssetContainer to another scene.

If it is possible, I would like to propose adding a cloneModelsToScene method to the AssetContainer class in Babylon.js. This would allow for more efficient use of resources and faster scene loading times when using multiple scenes with similar models.

Before proposing this feature, I wanted to ask if there are any plans to add it to a future release. If not, I would be happy to submit a feature request and provide any additional information or code examples if needed.

Thank you for your consideration, and I look forward to hearing your thoughts on this proposal.

@MILIFIRE I love the overall idea but it is a rather really complex feature :frowning:

To summarize, so far today every single element that is created belongs to a scene. (mesh, materials, lights,…) and their clone/instantiate functions can only do it within their current scene as some parts are still used through references.

What we would nee:

  1. Every “elements” at play should be able to be cloned in a separate scene
  2. Tree cloning are available in a separate scene
  3. Asset container clone (no remove/add and such) can work across scene

Despite being interested it is probably not a small endeavor to ensure we are not leaking or keeping cross scene references.

Let s see how much traction this gets to consider it for 7.0 ?