Skip to content

Commit e367e2b

Browse files
FBXLoader: Use getHandler() for custom texture loaders. (#31032)
* add capable of custom texture loader * replace factory to setXXXLoader * Update FBXLoader.js * fix indent * use manager.getHandler * fix loader variable name * fix url * use getHandler for all extensions * Update FBXLoader.js Clean up. --------- Co-authored-by: Michael Herzog <[email protected]>
1 parent 984ca4a commit e367e2b

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

examples/jsm/loaders/FBXLoader.js

+2-13
Original file line numberDiff line numberDiff line change
@@ -437,21 +437,10 @@ class FBXTreeParser {
437437
// load a texture specified as a blob or data URI, or via an external URL using TextureLoader
438438
loadTexture( textureNode, images ) {
439439

440-
const nonNativeExtensions = new Set( [ 'tga', 'tif', 'tiff', 'exr', 'dds', 'hdr', 'ktx2' ] );
441-
442440
const extension = textureNode.FileName.split( '.' ).pop().toLowerCase();
443441

444-
const loader = nonNativeExtensions.has( extension ) ? this.manager.getHandler( `.${extension}` ) : this.textureLoader;
445-
446-
if ( ! loader ) {
447-
448-
console.warn(
449-
`FBXLoader: ${extension.toUpperCase()} loader not found, creating placeholder texture for`,
450-
textureNode.RelativeFilename
451-
);
452-
return new Texture();
453-
454-
}
442+
let loader = this.manager.getHandler( `.${extension}` );
443+
if ( loader === null) loader = this.textureLoader;
455444

456445
const loaderPath = loader.path;
457446

0 commit comments

Comments
 (0)