Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to load embed TGA in FBX #15718

Closed
hifar opened this issue Feb 5, 2019 · 4 comments · Fixed by #16993
Closed

failed to load embed TGA in FBX #15718

hifar opened this issue Feb 5, 2019 · 4 comments · Fixed by #16993
Labels

Comments

@hifar
Copy link

hifar commented Feb 5, 2019

Description of the problem

Failed to load embed TGA in FBX, reason is set the path in TGA loader

suggest adding below check in LoadTexture function of FBXLoader.js

  	if ( extension === 'tga' ) {
  	    console.log(THREE.Loader.Handlers.handlers);
  		var loader = THREE.Loader.Handlers.get( '.tga' );
  		console.log(loader);
  		if ( loader === null ) {

  			console.warn( 'FBXLoader: TGALoader not found, creating empty placeholder texture for', fileName );

  			texture = new THREE.Texture();

  		} else {
                //Check embed Media, if true , set path to undefined
  		    if (fileName.indexOf('blob:') === 0 || fileName.indexOf('data:') === 0) {
  		        loader.setPath(undefined);
  		    }
  			texture = loader.load( fileName );

  		}
@looeee
Copy link
Collaborator

looeee commented Feb 6, 2019

Can you share the model here?

@Mugen87 Mugen87 added the Loaders label Feb 6, 2019
@hifar
Copy link
Author

hifar commented Feb 6, 2019

you can try this fbx.

test1.zip

To reproduce this, you can export TGA Texture model to fbx in 3ds max with embed media option.

After I added this check code , this issue can be resolved.

  	    if (fileName.indexOf('blob:') === 0 || fileName.indexOf('data:') === 0) {
  	        loader.setPath(undefined);
  	    }

@Roar1827
Copy link

@hifar I'm experiencing this same warning. Were you able to work around it? Thanks.

@looeee
Copy link
Collaborator

looeee commented Jul 9, 2019

Fixed in #16993

You'll need t add the TGALoader like this in your app before using the FBXLoader:

THREE.Loader.Handlers.add( /\.tga$/i, new TGALoader() );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants