Explorar el Código

GLTFLoader: Clean up

Takahiro hace 6 años
padre
commit
404fe233bc
Se han modificado 1 ficheros con 5 adiciones y 6 borrados
  1. 5 6
      examples/js/loaders/GLTFLoader.js

+ 5 - 6
examples/js/loaders/GLTFLoader.js

@@ -2329,14 +2329,13 @@ THREE.GLTFLoader = ( function () {
 
 
 		if ( primitiveDef.indices !== undefined && ! geometry.index ) {
 		if ( primitiveDef.indices !== undefined && ! geometry.index ) {
 
 
-			pending.push(
-				parser.getDependency( 'accessor', primitiveDef.indices )
-					.then( function ( accessor ) {
+			var accessor = parser.getDependency( 'accessor', primitiveDef.indices ).then( function ( accessor ) {
 
 
-					geometry.setIndex( accessor );
+				geometry.setIndex( accessor );
 
 
-				} )
-			);
+			} );
+
+			pending.push( accessor );
 
 
 		}
 		}