Skip to content

Commit

Permalink
GLTFLoader: Prevents set data uri in texture.name. (mrdoob#25682)
Browse files Browse the repository at this point in the history
* GLTFLoader: Prevents set data uri in texture.name.

* cleanup

* fix maybe optional value

* cleanup
  • Loading branch information
sunag committed Mar 20, 2023
1 parent e419f11 commit aab74fc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/jsm/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ] || {};
Expand Down

0 comments on commit aab74fc

Please sign in to comment.