HELP! Possible to load multiple gltf objects on a single loader?

Hi gurus, sorry for the noob question but I search everywhere and I can’t find the answers.
so I am using gltf loader plugin to load a gltf object, but I would like to use ONE single gltf loader to load multiple gltf objects, is it possible to do that?

loader = new GLTFLoader();
	loader.load("models/tmp.glb", function(gltf) { // do something here }

as you can see that, the loader only takes one .glb file to load, what I want is load a second .glb but using the same loader(maybe as an arrary?), so that I can tweak everything(materials that share the same name for those glb) for those two glb objects at the same time.

currently I have to seperate them into different loader for such as var a loader1 and a loader2 and then tweak them seperately, it’s painful since those glb has many same material name sharing exactly the same settings with each other.

Is it a stupid behaviour for a noob like me dealing with this situation? Please guide me through, thank you guys so much. and THREEjs rocks the world forever :slight_smile:

You can using THREE.LoadingManager() for manage event when object loaded !

This works:

loader.load("models/model1.glb", function(gltf) { // do something with model 1 here } )
loader.load("models/model2.glb", function(gltf) { // do something with model 2 here } )

Just remember that loading models is asynchronous, which means that you don’t know which model will finish first (model 2 might load before model 1 if it’s smaller, for example).

You can’t load more than one model in a single loader.load call, but what you should do is create an onLoad function to process each loaded model.

A very simple one looks like this:

function onLoad( gltf ) {

   console.log( gltf );

   scene.add( gltf.scene.children );


Then you can use it like this to add each loaded model to the scene:

loader.load("models/model1.glb", onLoad );
loader.load("models/model2.glb", onLoad );