瀏覽代碼

MaterialXLoader: Respect handlers attached to manager when loading textures (#27432)

Matches how GLTFloader does this
hybridherbst 1 年之前
父節點
當前提交
8ca5469c99
共有 1 個文件被更改,包括 11 次插入1 次删除
  1. 11 1
      examples/jsm/loaders/MaterialXLoader.js

+ 11 - 1
examples/jsm/loaders/MaterialXLoader.js

@@ -326,7 +326,17 @@ class MaterialXNode {
 
 
 		const filePrefix = this.getRecursiveAttribute( 'fileprefix' ) || '';
 		const filePrefix = this.getRecursiveAttribute( 'fileprefix' ) || '';
 
 
-		const texture = this.materialX.textureLoader.load( filePrefix + this.value );
+		let loader = this.materialX.textureLoader;
+		const uri = filePrefix + this.value;
+
+		if ( uri ) {
+
+			const handler = this.materialX.manager.getHandler( uri );
+			if ( handler !== null ) loader = handler;
+
+		}
+
+		const texture = loader.load( uri );
 		texture.wrapS = texture.wrapT = RepeatWrapping;
 		texture.wrapS = texture.wrapT = RepeatWrapping;
 		texture.flipY = false;
 		texture.flipY = false;