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.
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?
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?