FBX file is fine but not getting loaded in chrome but working fine with sample file

Reference to the link : https://github.com/mrdoob/three.js/issues/13385#issuecomment-367633829

The .fbx file is fine & Im using the sample code but still fbx is not working form me in chrome!?


@nnavaneetha the example code works in its own demo, so there is something about your situation that is different… For us to help you with this question, can you provide a demo? Ideally in Codepen or Neocities or something live, or a ZIP if that’s not possible? Any errors in the JS console? If I drag the file into https://threejs.org/editor/ it works as well. The example you link to uses a very large model, and yours is 1000x smaller; you may just need to scale things appropriately.

Thanks for the reply

Sure,please find the attached code & the respective fbx file

FBX file :


Source code :


Hi ,

Im using the sample code from ‘webgl_loader_fbx’ from three.js with my own fbx file ,attached in the above reference.

Other sample fbx file are working fine from my local!


It’s worth knowing three.js loaders have both an onLoad callback and an onError callback. Because this example doesn’t include any error callback, errors aren’t printed and (as you’ve discovered) it’s much harder to find out why something doesn’t work. :slight_smile: You can add it as follows:

loader.load( 'my_model.fbx', function (object) {
  // ... add object as usual
}, undefined, function (error) {
} );

Once you add that, the error is pretty easy to spot in the JS console:

TypeError: clipObject is undefined
Stack trace:

in short, that means you just need to remove the lines about animation mixers and clip.play(), because your model has no animation. It also helps to remove the floor, since it’s the same color as the model.


1 Like

Thanks. You’ve just made my day :slight_smile:
Appreciate your quick turn around time.

We previously had a conditional statement around the animation code in the example. Since people use it as a starting point, and this is an easy thing to be confused about, perhaps we should add that back?

Or including the onError callback maybe. The GLTFLoader example should probably do the same…

Or perhaps both :grin:
Personally I found the if statement around animation code great for quickly testing lots of models.

But yeah, we should definitely at least be including the onError callback.