Browse Source

GLTFLoader: Clean up

Takahiro 6 years ago
parent
commit
404fe233bc
1 changed files with 5 additions and 6 deletions
  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 ) {
 
-			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 );
 
 		}