Browse Source

ObjectLoader: Fixed editor breakage. Fixes #6091.

Mr.doob 10 years ago
parent
commit
fcf54cd2ed
1 changed files with 6 additions and 16 deletions
  1. 6 16
      src/loaders/ObjectLoader.js

+ 6 - 16
src/loaders/ObjectLoader.js

@@ -46,23 +46,13 @@ THREE.ObjectLoader.prototype = {
 
 	parse: function ( json, onLoad ) {
 
-		var scope = this;
-		var geometries, materials, images, textures;
-
-		this.manager.itemStart( json.object.uuid );
-
-		geometries = this.parseGeometries( json.geometries );
-		images = this.parseImages( json.images, function () {
-
-			textures  = scope.parseTextures( json.textures, images );
-			materials = scope.parseMaterials( json.materials, textures );
-
-			onLoad( scope.parseObject( json.object, geometries, materials ) );
+		var geometries = this.parseGeometries( json.geometries );
 
-			// report back to parent manager
-			scope.manager.itemEnd( json.object.uuid );
+		var images = this.parseImages( json.images, onLoad );
+		var textures  = this.parseTextures( json.textures, images );
+		var materials = this.parseMaterials( json.materials, textures );
 
-		} );
+		return this.parseObject( json.object, geometries, materials );
 
 	},
 
@@ -281,7 +271,7 @@ THREE.ObjectLoader.prototype = {
 
 		} else {
 
-			onLoad();
+			if ( onLoad !== undefined ) onLoad();
 
 		}