# Correctly loading several GLB models into AssetContainer

**URL:** <https://forum.babylonjs.com/t/correctly-loading-several-glb-models-into-assetcontainer/58088>\
**Category:** Questions\
**Created:** [April 27, 2025, 1:04am UTC](https://forum.babylonjs.com/t/correctly-loading-several-glb-models-into-assetcontainer/58088 "2025-04-27T01:04:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dleon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dleon/32/44542_2.png) [@dleon](https://forum.babylonjs.com/u/dleon)\
**Post date:** [April 27, 2025, 1:04am UTC](https://forum.babylonjs.com/t/correctly-loading-several-glb-models-into-assetcontainer/58088/1 "2025-04-27T01:04:14Z")

</div>

I have some difficulties with loading several glb models from different files into AssetContainer. As far as I know assetContainer does not have methods to add a model to an existing container.

I tried this method:

```auto
let container = new AssetContainer();
ImportMeshAsync().then((loaded)=>{
      let root = loaded.meshes[0];
      root.name = root.id = 'name';
      container.meshes.push(root);
      container.removeAllFromScene();
   }
);

```

How correct is this approach and are there any alternatives?  
What other resources should I add to the container besides the main mesh.  
if I do the same with materials, they disappear from the scene after calling removeAllFromScene() (I see them in the Inspector), but if I add Skeletons or AnimationGroups, they do not disappear from the scene.

I would be glad to hear your advice and comments!

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [April 27, 2025, 1:13am UTC](https://forum.babylonjs.com/t/correctly-loading-several-glb-models-into-assetcontainer/58088/2 "2025-04-27T01:13:41Z")

</div>

I believe the best alternative which is specially designed for this purpose is LoadAssetContainerAsync function.  
Docs - [Babylon.js docs](https://doc.babylonjs.com/typedoc/functions/BABYLON.LoadAssetContainerAsync-1)

> **[Babylon.js Playground](https://playground.babylonjs.com/#JPTSK5)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

---

<div class="post-metadata">

**Author:** ![dleon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dleon/32/44542_2.png) [@dleon](https://forum.babylonjs.com/u/dleon)\
**Post date:** [April 27, 2025, 1:27am UTC](https://forum.babylonjs.com/t/correctly-loading-several-glb-models-into-assetcontainer/58088/3 "2025-04-27T01:27:48Z")

</div>

As far as I understand LoadAssetContainerAsync loads one glb (for example) and returns one container. If I want to load multiple models, I will have multiple containers. How correct is this and can it affect performance more than the existence of one container with multiple assets?

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [April 27, 2025, 1:59am UTC](https://forum.babylonjs.com/t/correctly-loading-several-glb-models-into-assetcontainer/58088/4 "2025-04-27T01:59:38Z")

</div>

> [@dleon](#):
>
> How correct is this and can it affect performance more than the existence of one container with multiple assets?

This is completely correct and very convenient. For multiple containers just create an array and iterate with needed functions. The performance affect is less than negligible.

Some explanations from another thread:

> [@Update the PG of the Documentation DEMOS for Sceneloader ImportMesh, Append](https://forum.babylonjs.com/t/update-the-pg-of-the-documentation-demos-for-sceneloader-importmesh-append/56815/24):
>
> Yes, this is exactly the expected behavior. The .babylon file you are loading has Lights in it. When you use ImportMeshAsync, you are import meshes only. Everything else in the file is ignored. When you use LoadAssetContainerAsync, you are bringing in everything from the file, and if you call addToScene with no arguments, you are adding everything to the scene (including lights). If you added only meshes (e.g. result2.addToScene(entity =\> entity instanceof BABYLON.AbstractMesh)) then the behavi…

---

<div class="post-metadata">

**Author:** ![dleon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dleon/32/44542_2.png) [@dleon](https://forum.babylonjs.com/u/dleon)\
**Post date:** [April 27, 2025, 2:18am UTC](https://forum.babylonjs.com/t/correctly-loading-several-glb-models-into-assetcontainer/58088/5 "2025-04-27T02:18:15Z")

</div>

Thanks. You have cleared my doubts.
