Przeglądaj źródła

FBXLoader: Improve error handling. (#31017)

Michael Herzog 10 miesięcy temu
rodzic
commit
817c791b01
1 zmienionych plików z 7 dodań i 0 usunięć
  1. 7 0
      examples/jsm/loaders/FBXLoader.js

+ 7 - 0
examples/jsm/loaders/FBXLoader.js

@@ -477,6 +477,13 @@ class FBXTreeParser {
 
 
 		}
 		}
 
 
+		if ( fileName === undefined ) {
+
+			console.warn( 'FBXLoader: Undefined filename, creating placeholder texture.' );
+			return new Texture();
+
+		}
+
 		const texture = loader.load( fileName );
 		const texture = loader.load( fileName );
 
 
 		// revert to initial path
 		// revert to initial path

粤ICP备19079148号