# SceneLoader.ImportMeshAsync to an AssetContainer or similar?

**URL:** <https://forum.babylonjs.com/t/sceneloader-importmeshasync-to-an-assetcontainer-or-similar/36491>\
**Category:** Questions\
**Created:** [December 12, 2022, 7:36pm UTC](https://forum.babylonjs.com/t/sceneloader-importmeshasync-to-an-assetcontainer-or-similar/36491 "2022-12-12T19:36:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicoraf](https://avatars.discourse-cdn.com/v4/letter/n/ad7895/32.png) [@nicoraf](https://forum.babylonjs.com/u/nicoraf)\
**Post date:** [December 12, 2022, 7:36pm UTC](https://forum.babylonjs.com/t/sceneloader-importmeshasync-to-an-assetcontainer-or-similar/36491/1 "2022-12-12T19:36:27Z")

</div>

Hello,

I would like to preload several different scenes without actually going to render them. I would like to have them preloaded so I can switch from Scenes without having to download the binary data.

I addition, I am interested to modify dynamically those scenes, like adding some meshes of other Scenes etc.

The process I would ideally would like to have is to preload several scenes inside for example an Asset Container. Then modify the AssetContainers and add for example a light or a predefined mesh. Then keep a copy of that AssetContainer , and when I want to be displayed , clone it and assign it as the Scene of the Engine instance.

To my understanding SceneLoader.ImportMeshAsync has as output Scene and not AbstractScene. So I cannot use AssetContainer as output type. I would like if there is a way to achieve what I mentioned before.

Thanks

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [December 12, 2022, 8:11pm UTC](https://forum.babylonjs.com/t/sceneloader-importmeshasync-to-an-assetcontainer-or-similar/36491/2 "2022-12-12T20:11:37Z")

</div>

You can use LoadAssetContainer or LoadAssetContainerAsync maybe? [BlendWebMix | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#JA1ND3#48)

---

<div class="post-metadata">

**Author:** ![nicoraf](https://avatars.discourse-cdn.com/v4/letter/n/ad7895/32.png) [@nicoraf](https://forum.babylonjs.com/u/nicoraf)\
**Post date:** [December 12, 2022, 8:43pm UTC](https://forum.babylonjs.com/t/sceneloader-importmeshasync-to-an-assetcontainer-or-similar/36491/3 "2022-12-12T20:43:28Z")

</div>

Hi,

Some comments,

1. to my understanding the constructor of HemisphericLight receives a Scene as parameter not an AssetContainer, it seems to work, but it does not respect the signature. Same for the constructor of FreeCamera .

2. The asset container can be potentially modified inside the scene? I wonder if it is possible to clone the Asset container or do something equivalent ?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [December 13, 2022, 11:26am UTC](https://forum.babylonjs.com/t/sceneloader-importmeshasync-to-an-assetcontainer-or-similar/36491/4 "2022-12-13T11:26:18Z")

</div>

1. Hmmm the intended way of using AssetContainer is to instantiate the objects into a scene and then adding them to the container, not instantiating directly to the container
2. Well you have the add and remove methods, but it would be better to have a playground to see exactly what you intend to do…
