diff --git a/examples/js/loaders/FBXLoader.js b/examples/js/loaders/FBXLoader.js index c7a0f3b440dca6a4677843270f3bba17c9887be9..a5cea17fe2dc0d4978cc63f804fdacca024102dd 100644 --- a/examples/js/loaders/FBXLoader.js +++ b/examples/js/loaders/FBXLoader.js @@ -288,27 +288,15 @@ THREE.FBXLoader = ( function () { case 'tga': - if ( typeof THREE.TGALoader !== 'function' ) { + if ( THREE.Loader.Handlers.get( '.tga' ) === null ) { - console.warn( 'FBXLoader: THREE.TGALoader is required to load TGA textures' ); - return; - - } else { - - if ( THREE.Loader.Handlers.get( '.tga' ) === null ) { - - var tgaLoader = new THREE.TGALoader(); - tgaLoader.setPath( this.textureLoader.path ); - - THREE.Loader.Handlers.add( /\.tga$/i, tgaLoader ); - - } - - type = 'image/tga'; - break; + console.warn( 'FBXLoader: TGA loader not found, skipping ', fileName ); } + type = 'image/tga'; + break; + default: console.warn( 'FBXLoader: Image type "' + extension + '" is not supported.' ); @@ -417,7 +405,7 @@ THREE.FBXLoader = ( function () { if ( loader === null ) { - console.warn( 'FBXLoader: TGALoader not found, creating empty placeholder texture for', fileName ); + console.warn( 'FBXLoader: TGA loader not found, creating placeholder texture for', textureNode.RelativeFilename ); texture = new THREE.Texture(); } else { @@ -428,7 +416,7 @@ THREE.FBXLoader = ( function () { } else if ( extension === 'psd' ) { - console.warn( 'FBXLoader: PSD textures are not supported, creating empty placeholder texture for', fileName ); + console.warn( 'FBXLoader: PSD textures are not supported, creating placeholder texture for', textureNode.RelativeFilename ); texture = new THREE.Texture(); } else { @@ -1554,6 +1542,7 @@ THREE.FBXLoader = ( function () { }, + // Parse single node mesh geometry in FBXTree.Objects.Geometry parseMeshGeometry: function ( relationships, geoNode, deformers ) { diff --git a/examples/jsm/loaders/FBXLoader.js b/examples/jsm/loaders/FBXLoader.js index d1ef07ce660293368dcd50f58e08668130b5c11e..a48a3d44642a34398d88bd87b9584472df9b6112 100644 --- a/examples/jsm/loaders/FBXLoader.js +++ b/examples/jsm/loaders/FBXLoader.js @@ -64,7 +64,6 @@ import { VertexColors } from "../../../build/three.module.js"; import { Zlib } from "../libs/inflate.module.min.js"; -import { TGALoader } from "../loaders/TGALoader.js"; import { NURBSCurve } from "../curves/NURBSCurve.js"; @@ -337,27 +336,15 @@ var FBXLoader = ( function () { case 'tga': - if ( typeof TGALoader !== 'function' ) { + if ( Loader.Handlers.get( '.tga' ) === null ) { - console.warn( 'FBXLoader: TGALoader is required to load TGA textures' ); - return; - - } else { - - if ( Loader.Handlers.get( '.tga' ) === null ) { - - var tgaLoader = new TGALoader(); - tgaLoader.setPath( this.textureLoader.path ); - - Loader.Handlers.add( /\.tga$/i, tgaLoader ); - - } - - type = 'image/tga'; - break; + console.warn( 'FBXLoader: TGA loader not found, skipping ', fileName ); } + type = 'image/tga'; + break; + default: console.warn( 'FBXLoader: Image type "' + extension + '" is not supported.' ); @@ -466,7 +453,7 @@ var FBXLoader = ( function () { if ( loader === null ) { - console.warn( 'FBXLoader: TGALoader not found, creating empty placeholder texture for', fileName ); + console.warn( 'FBXLoader: TGA loader not found, creating placeholder texture for', textureNode.RelativeFilename ); texture = new Texture(); } else { @@ -477,7 +464,7 @@ var FBXLoader = ( function () { } else if ( extension === 'psd' ) { - console.warn( 'FBXLoader: PSD textures are not supported, creating empty placeholder texture for', fileName ); + console.warn( 'FBXLoader: PSD textures are not supported, creating placeholder texture for', textureNode.RelativeFilename ); texture = new Texture(); } else { @@ -1603,6 +1590,7 @@ var FBXLoader = ( function () { }, + // Parse single node mesh geometry in FBXTree.Objects.Geometry parseMeshGeometry: function ( relationships, geoNode, deformers ) { diff --git a/utils/modularize.js b/utils/modularize.js index 3e1e701c73e5681c2c9b9af2f5106fa8c6f8fdf6..443d87440be0c7b04ca77433dd486e213f5c8d7f 100644 --- a/utils/modularize.js +++ b/utils/modularize.js @@ -87,7 +87,7 @@ var files = [ { path: 'loaders/DRACOLoader.js', dependencies: [], ignoreList: [ 'LoadingManager' ] }, { path: 'loaders/EXRLoader.js', dependencies: [], ignoreList: [] }, { path: 'loaders/EquirectangularToCubeGenerator.js', dependencies: [], ignoreList: [] }, - { path: 'loaders/FBXLoader.js', dependencies: [ { name: 'Zlib', path: 'libs/inflate.module.min.js' }, { name: 'TGALoader', path: 'loaders/TGALoader.js' }, { name: 'NURBSCurve', path: 'curves/NURBSCurve.js' } ], ignoreList: [] }, + { path: 'loaders/FBXLoader.js', dependencies: [ { name: 'Zlib', path: 'libs/inflate.module.min.js' }, { name: 'NURBSCurve', path: 'curves/NURBSCurve.js' } ], ignoreList: [] }, { path: 'loaders/GCodeLoader.js', dependencies: [], ignoreList: [] }, { path: 'loaders/GLTFLoader.js', dependencies: [], ignoreList: [ 'NoSide', 'Matrix2', 'Camera', 'Texture' ] }, { path: 'loaders/HDRCubeTextureLoader.js', dependencies: [ { name: 'RGBELoader', path: 'loaders/RGBELoader.js' } ], ignoreList: [] },