소스 검색

GLTFLoader: Prevents set data uri in texture.name. (#25682)

* GLTFLoader: Prevents set data uri in texture.name.

* cleanup

* fix maybe optional value

* cleanup
sunag 2 년 전
부모
커밋
114134e195
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      examples/jsm/loaders/GLTFLoader.js

+ 7 - 1
examples/jsm/loaders/GLTFLoader.js

@@ -2988,7 +2988,13 @@ class GLTFParser {
 
 			texture.flipY = false;
 
-			texture.name = textureDef.name || sourceDef.name || sourceDef.uri || '';
+			texture.name = textureDef.name || sourceDef.name || '';
+
+			if ( texture.name === '' && typeof sourceDef.uri === 'string' && sourceDef.uri.startsWith( 'data:image/' ) === false ) {
+
+				texture.name = sourceDef.uri;
+
+			}
 
 			const samplers = json.samplers || {};
 			const sampler = samplers[ textureDef.sampler ] || {};