Loading multiple models from one gltf file

Hey, it’s been a while.

I am trying to create multiple viewports for model analysis (split screens). I’ve read the best way to do this is with multiple viewports instead of duplicating engines etc.

a playground that does what we need is

However, as models will be coming over in one file I cannot append more to the scene. I have gone in the direction of trying to pull out another scene from the gltf data using onParsedObservable but am unsure how I can create another scene.

I’ve looked into asset management and multiple scenes however, am struggling to do anything with the data structure. I know when you load a file it looks for the first scene but what if I have two scenes in the file, is there a way that I can use SceneLoad from a different root?

current playground with string data loading and onParsedObservable

I don’t have any good ideas for this one if keeping the scenes separate is a requirement :thinking: maybe @sebavan knows?

Is there any benefit to having seperate scenes? My fellow team member is thinking the best way to do this would be to create viewports and pull the meshes from pre-processing. Am happy to go down that route, its just when I looked at what is out there, people seem to create additional scenes

It is currently not possible to store several scenes in a gltf for Babylon All the parsed data are actually attached to the scene.

In your case having several models loaded from one file displayed in various places of the canvas, it sounds simpler to rely on viewport ?

Yeah loading it all and splitting them into viewports is the way i’ll go with it. thanks for replying

1 Like