Skip to content

Commit

Permalink
MaterialXLoader: Respect handlers attached to manager when loading te…
Browse files Browse the repository at this point in the history
…xtures (#27432)

Matches how GLTFloader does this
  • Loading branch information
hybridherbst committed Dec 23, 2023
1 parent 299f53f commit 8ca5469
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion examples/jsm/loaders/MaterialXLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,17 @@ class MaterialXNode {

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.flipY = false;

Expand Down

0 comments on commit 8ca5469

Please sign in to comment.