1

Trying to load multiple fbx in a function, i try different ways to do that in same function, separate functions, same loader, different loaders, etc. but nothing seems to work and the result is same it only loads the first .fbx. This is the code that i have:

function loadModels(){
 //model1
 var loader1 = new THREE.FBXLoader();
 loader1.load( 'models/model1.fbx', function ( model1 ) {
 scene.add( model1 );
 } );
 //model2
 var loader2 = new THREE.FBXLoader();
 loader2.load( 'models/model2.fbx', function ( model2 ) {
 scene.add( model2 );
 } );
 animate();
}
asked Aug 21, 2018 at 14:45
8
  • Please give some more information about your code. Otherwise it will be hard to help you. Are there any error logs in the console? Maybe the second model is malformed and results in an error. Will model2 load if you load only this model into your scene? Is model1 bigger than model2? Maybe model2 is just inside model1 as you add both models to the same position (0,0,0) Commented Aug 21, 2018 at 15:45
  • Hi, there arent console errors the problem seems to be when i try to load more than one fbx. If i load one of them no matter which one it loads ok. There are no problems of size. And also i convert one fbx to obj and load a fbx and a obj and they load ok. That been said i think that is a problem with the fbx loader of three js o the way that im using it. Commented Aug 21, 2018 at 16:25
  • 1
    Wow I just ran into this last night.. and I think it's a bug in the FBX loader. Commented Aug 21, 2018 at 19:14
  • If you pass the extra parameters to the FBXLoader.load .. a "progress()" and an "error()" function, do you find that your error() function is getting called with "FBXTree is not a constructor"? Commented Aug 21, 2018 at 19:16
  • 1
    And if this does not work you could try out an older version of threejs and update when the bug is fixed github.com/mrdoob/three.js/releases Commented Aug 22, 2018 at 7:36

1 Answer 1

1

Had same issue. Fixed by replacing examples/js/loaders/FBXLoader.js to newer version from https://github.com/mrdoob/three.js/ (current revision 96)

Problem was that FBXLoader.js had exact same typing "FBXTree" for variable and function name

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.