Browse Source

Editor: Fixed GLTF file loading. See #9866

Mr.doob 8 years ago
parent
commit
4ded58a4ba
1 changed files with 4 additions and 3 deletions
  1. 4 3
      editor/js/Loader.js

+ 4 - 3
editor/js/Loader.js

@@ -163,11 +163,12 @@ var Loader = function ( editor ) {
 						var json = JSON.parse( contents );
 
 						var loader = new THREE.GLTFLoader();
-						var collada = loader.parse( json );
+						loader.parse( json, function ( result ) {
 
-						collada.scene.name = filename;
+							result.scene.name = filename;
+							editor.execute( new AddObjectCommand( result.scene ) );
 
-						editor.execute( new AddObjectCommand( collada.scene ) );
+						} );
 
 					}, false );
 					reader.readAsText( file );