Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLTFLoader: Fix bug when loading external WebP texture #21282

Merged
merged 6 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
14 changes: 13 additions & 1 deletion examples/js/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,19 @@ 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;
if ( source.uri ) {

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

}

if ( ! loader ) {
gkjohnson marked this conversation as resolved.
Show resolved Hide resolved

loader = parser.textureLoader;

}

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

Expand Down
14 changes: 13 additions & 1 deletion examples/jsm/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,19 @@ 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;
if ( source.uri ) {

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

}

if ( ! loader ) {

loader = parser.textureLoader;

}

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

Expand Down