Issue Loading FBX with imbedded TGA

I am trying to load this Fish into the fbx loader but i get errors as such

FBXLoader: TGA loader not found, skipping  source\photoshop\7288_barramundi fish_col.tga Test.bundle.js:52532:15
FBXLoader: TGA loader not found, skipping  source\photoshop\7288_barramundi fish_occ.tga Test.bundle.js:52532:15
FBXLoader: TGA loader not found, skipping  source\photoshop\7288_barramundi fish_spc.tga Test.bundle.js:52532:15
FBXLoader: TGA loader not found, skipping  source\photoshop\7288_barramundi fish_nml.tga Test.bundle.js:52532:15
FBXLoader: TGA loader not found, creating placeholder texture for source\photoshop\7288_barramundi fish_col.tga Test.bundle.js:52647:14
FBXLoader: TGA loader not found, creating placeholder texture for source\photoshop\7288_barramundi fish_occ.tga Test.bundle.js:52647:14
FBXLoader: TGA loader not found, creating placeholder texture for source\photoshop\7288_barramundi fish_spc.tga Test.bundle.js:52647:14
FBXLoader: TGA loader not found, creating placeholder texture for source\photoshop\7288_barramundi fish_nml.tga Test.bundle.js:52647:14
THREE.FBXLoader: AmbientColor map is not supported in three.js, skipping texture. Test.bundle.js:52877:15
THREE.FBXLoader: ignoredShadingConnections map is not supported in three.js, skipping texture.

I am working in React+Typescript+webpack. I have OBJ2Loader and GLTFLoader working but have yet to get the FBX to work with embedded items I suppose.

The line suggested about 10 time is ‘THREE.Loader.Handlers.add( /.tga$/i, new TGALoader())’
but Handlers doesn’t seem to exist on Loader. I am basically following the generic code and it does just load a black object the shape of the fish. There are lights, so that is not the issue.

There is no documentation on 80% of the loaders is there a reason?

const loader = new FBXLoader()
loader.load('url', (fbx) => {
    this.scene.add(fbx) // this.scene is how I display the object in react
})

here is a gist of the basic code being used to load the fbx which it does load the shape. Just not the colors or textures that are I assume embedded in the fbx. Which loads using the windows 3d viewer.

I think LoadingManager.addHandler is what you need here.

const manager = new LoadingManager();
// add handler for TGA textures
manager.addHandler( /\.tga$/i, new TGALoader() );

const loader = new FBXLoader(manager);
3 Likes

Awesome that was exactly what I needed.

1 Like