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:
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.
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?
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.