Skip to content

Commit

Permalink
ObjectLoader: Handle empty json.image case. See b3b9d8b.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Feb 20, 2015
1 parent 0eb4905 commit c223a4c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/loaders/ObjectLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,17 @@ THREE.ObjectLoader.prototype = {

var geometries = this.parseGeometries( json.geometries );

var images = this.parseImages( json.images, function () {

if ( onLoad !== undefined ) onLoad( object );

} );
var images = this.parseImages( json.images, onLoad );
var textures = this.parseTextures( json.textures, images );
var materials = this.parseMaterials( json.materials, textures );
var object = this.parseObject( json.object, geometries, materials );

if ( json.images === undefined || json.images.length === 0 ) {

if ( onLoad !== undefined ) onLoad( object );

}

return object;

},
Expand Down Expand Up @@ -314,10 +316,6 @@ THREE.ObjectLoader.prototype = {

}

} else {

if ( onLoad !== undefined ) onLoad();

}

return images;
Expand Down

0 comments on commit c223a4c

Please sign in to comment.