FBX Loader not working, Callback never called

Hi there,

my base is the FBXLoader example from the three.js codebase, the sample FBX and animation load fine.
Trying to load one of my own FBX just shows an empty scene. There are no errors in the console, however when debugging i can see that the callback passed to loader.load is never called with my model, while it is with the sample model. Now i wonder if this is due to missing textures or something, but should i not see an error in this case ?

Using r92 right now. The model i am testing with is this:

After digging a bit more, it indeed seems that the loader can not load the associated tga texture file and then fails silently. Is this a bug or am i missing a TGA loader ?

You’ll need to include the TGALoader.js script as well, and make sure that you’re using the lastest version as support for TGA files was just added in the last release.

You should have got a warning about this though:

I encounter the same issue, no warning message show here

@Liu_Hao these questions usually have something to do with the particular model you’re using. If you can share that, please do.

Otherwise, ensure that you’ve used an onError callback when loading the model.

loader.load( function () {
}, undefined, function (e) {

Thanks, I added the onError callback, the console print this error:

TypeError: Cannot read property 'load' of null
    at loadTexture (FBXLoaderNeo.js:365)
    at parseTexture (FBXLoaderNeo.js:309)
    at parseTextures (FBXLoaderNeo.js:295)
    at THREE.FBXLoader.parse (FBXLoaderNeo.js:98)
    at Object.onLoad (FBXLoaderNeo.js:47)
    at XMLHttpRequest.<anonymous> (three.js:30754)

I added this line before load may fbx model,
THREE.Loader.Handlers.add(/\.tga$/i, new THREE.TGALoader());
then it works, but the tga loader will try to find the resource in the root dir, so I have to copy my tga file from model dir to project root directory.
Is there some method to set tgaLoader 's root directory ? @donmccurdy @looeee

That seems likely to be a bug… perhaps FBXLoader should create a private TGALoader sharing the same LoadingManager, and set the appropriate path on it. Probably isn’t necessary to reuse TGALoader across multiple FBXLoader instances, right?

hi @Liu_Hao , have you sovle the set tgaLoader 's root directory problem ? I have the same issue too .

Since some days TGALoader has a setPath() method. https://github.com/mrdoob/three.js/commit/a91cd165ab9e3f5470ff6ad981161511ef469f6a

FBXLoader should create a single instance of TGALoader with the global LoadingManager and set the resource path (analogous to to ColladaLoader).

/cc @looeee

Was trying to solve this issue myself (although it seems like my problem is at least partially as a result of loading FBX files using URL.createObjectURL)…

That said, once TGALoader is included, why have a special case for external .tga texture filenames at all? Shouldn’t the textureLoader just report that the format is unrecognized? In other words, could that explicit .tga handling code be safely deleted?