2
0
Эх сурвалжийг харах

GLTFLoader: Return null when failing to load textures (#21977)

* GLTFLoader: Return null when failing to load textures

* GLTFLoader: Logging error when failing to load a texture.
Mr.doob 4 жил өмнө
parent
commit
cf079d48a8

+ 5 - 0
examples/jsm/loaders/GLTFLoader.js

@@ -2643,6 +2643,11 @@ class GLTFParser {
 
 			return texture;
 
+		} ).catch( function () {
+
+			console.error( 'THREE.GLTFLoader: Couldn\'t load texture', sourceURI );
+			return null;
+
 		} );
 
 		this.textureCache[ cacheKey ] = promise;