GLTFLoader: Timer warning on multiple models

Hello,

I’m loading multiple models into gltf loader and everything works fine, the models show up, if they have animation it works but in the console, I’m getting the following warning:


Example: Gltf - Multiple Models
Git repo: GitHub - m-a-y/gltf-multiple-models

So after the first model is loaded the next one causes a warning to appear. I have seen this issue on github but it says it happens only in IE. For me, it happens in Chrome and in Firefox (in fact in IE it works just fine): GLTFLoader - Internet Explorer Error · Issue #12683 · mrdoob/three.js · GitHub

Is this warning something that is normal to happen or am I making a mistake in my code?

Thanks :slightly_smiling_face:

EDIT: I have just checked the example on the three.js page and it shows up there as well so I would assume it is something normal?: three.js examples

I guess the problem is that console.time is called multiple times with the same label. You can easily reproduce this with the following fiddle:

https://jsfiddle.net/q0s1wcgw/

If you just load a single model with GLTFLoader, everything works fine. But when you start to load multiple models at the same time, you are running into this problem.

@donmccurdy I vote to fix this issue. What do you think?

Agreed… Maybe we should just not log the loading time at all? Seems like different loaders do many different things here, and the user can always add timing.

Yes. I think this approach is the best way to avoid confusion.

BTW: ColladaLoader uses console.time and console.timeEnd, too. We should also remove the related code from this loader.

I’m also experiencing this problem. Removing my from my loader manually.

Seems like different loaders do many different things here, and the user can always add timing.

For the FBXLoader I decided not to add a timer for this exact reason. However, it would be easy to overcome the problem using performance.now instead of console.time.

EDIT: just noticed this thread is a year old. @Mugen87, @donmccurdy has this been fixed in the other loaders since then?

This is fixed, see: https://github.com/mrdoob/three.js/pull/13770

2 Likes

Thanks, guess I forgot about that one :slightly_smiling_face:

@Andrew_Normore are you using the latest loader from GitHub?

No – I removed myself, it is working. I think my files are pretty old now, I should move to a new version.