Selaa lähdekoodia

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 vuotta sitten
vanhempi
commit
cf079d48a8
1 muutettua tiedostoa jossa 5 lisäystä ja 0 poistoa
  1. 5 0
      examples/jsm/loaders/GLTFLoader.js

+ 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;