Browse Source

Avoiding deprecated error message on SceneLoader too.

Mr.doob 13 years ago
parent
commit
a18a3b02a5
2 changed files with 5 additions and 13 deletions
  1. 2 2
      src/extras/loaders/JSONLoader.js
  2. 3 11
      src/extras/loaders/SceneLoader.js

+ 2 - 2
src/extras/loaders/JSONLoader.js

@@ -50,7 +50,7 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function( context, url, callback, text
 
 				try {
 
-					var jsonObject = JSON.parse( xhr.responseText );
+					var json = JSON.parse( xhr.responseText );
 
 				} catch ( error ) {
 
@@ -58,7 +58,7 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function( context, url, callback, text
 
 				}
 
-				context.createModel( jsonObject, callback, texturePath );
+				context.createModel( json, callback, texturePath );
 				context.onLoadComplete();
 
 			} else {

+ 3 - 11
src/extras/loaders/SceneLoader.js

@@ -21,7 +21,7 @@ THREE.SceneLoader.prototype.load = function( url, callbackFinished ) {
 
 	var xhr = new XMLHttpRequest();
 
-	xhr.onreadystatechange = function() {
+	xhr.onreadystatechange = function () {
 
 		if ( xhr.readyState == 4 ) {
 
@@ -31,22 +31,14 @@ THREE.SceneLoader.prototype.load = function( url, callbackFinished ) {
 
 					var json = JSON.parse( xhr.responseText );
 
-					if ( json.metadata === undefined || json.metadata.formatVersion === undefined || json.metadata.formatVersion !== 3 ) {
-
-						console.error( 'Deprecated file format.' );
-						return;
-
-					}
-
-					context.createScene( json, callbackFinished, url );
-
 				} catch ( error ) {
 
-					console.error( error );
 					console.warn( "DEPRECATED: [" + url + "] seems to be using old model format" );
 
 				}
 
+				context.createScene( json, callbackFinished, url );
+
 			} else {
 
 				console.error( "Couldn't load [" + url + "] [" + xhr.status + "]" );