Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 12 additions & 17 deletions examples/js/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,14 @@ THREE.GLTFLoader = ( function () {

var extension = textureDef.extensions[ name ];
var source = json.images[ extension.source ];
var loader = source.uri ? parser.options.manager.getHandler( source.uri ) : parser.textureLoader;

var loader = parser.textureLoader;
if ( source.uri ) {

var handler = parser.options.manager.getHandler( source.uri );
if ( handler !== null ) loader = handler;

}

return this.detectSupport().then( function ( isSupported ) {

Expand Down Expand Up @@ -2357,29 +2364,17 @@ THREE.GLTFLoader = ( function () {
*/
GLTFParser.prototype.loadTexture = function ( textureIndex ) {

var parser = this;
var json = this.json;
var options = this.options;

var textureDef = json.textures[ textureIndex ];
var source = json.images[ textureDef.source ];

var textureExtensions = textureDef.extensions || {};

var source;

source = json.images[ textureDef.source ];

var loader;
var loader = this.textureLoader;

if ( source.uri ) {

loader = options.manager.getHandler( source.uri );

}

if ( ! loader ) {

loader = this.textureLoader;
var handler = options.manager.getHandler( source.uri );
if ( handler !== null ) loader = handler;

}

Expand Down
29 changes: 12 additions & 17 deletions examples/jsm/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,14 @@ var GLTFLoader = ( function () {

var extension = textureDef.extensions[ name ];
var source = json.images[ extension.source ];
var loader = source.uri ? parser.options.manager.getHandler( source.uri ) : parser.textureLoader;

var loader = parser.textureLoader;
if ( source.uri ) {

var handler = parser.options.manager.getHandler( source.uri );
if ( handler !== null ) loader = handler;

}

return this.detectSupport().then( function ( isSupported ) {

Expand Down Expand Up @@ -2422,29 +2429,17 @@ var GLTFLoader = ( function () {
*/
GLTFParser.prototype.loadTexture = function ( textureIndex ) {

var parser = this;
var json = this.json;
var options = this.options;

var textureDef = json.textures[ textureIndex ];
var source = json.images[ textureDef.source ];

var textureExtensions = textureDef.extensions || {};

var source;

source = json.images[ textureDef.source ];

var loader;
var loader = this.textureLoader;

if ( source.uri ) {

loader = options.manager.getHandler( source.uri );

}

if ( ! loader ) {

loader = this.textureLoader;
var handler = options.manager.getHandler( source.uri );
if ( handler !== null ) loader = handler;

}

Expand Down