Browse Source

refining if statements

Sneha Belkhale 6 years ago
parent
commit
6a03a3393f
1 changed files with 2 additions and 10 deletions
  1. 2 10
      examples/js/loaders/GLTFLoader.js

+ 2 - 10
examples/js/loaders/GLTFLoader.js

@@ -2439,20 +2439,12 @@ THREE.GLTFLoader = ( function () {
 
 		for ( var gltfAttributeName in attributes ) {
 
-			var threeAttributeName = ATTRIBUTES[ gltfAttributeName ];
+			var threeAttributeName = ATTRIBUTES[ gltfAttributeName ] || gltfAttributeName.toLowerCase();
 
 			// Skip attributes already provided by e.g. Draco extension.
 			if ( threeAttributeName in geometry.attributes ) continue;
 
-			if ( threeAttributeName ) {
-
-				pending.push( assignAttributeAccessor( attributes[ gltfAttributeName ], threeAttributeName ) );
-
-			} else {
-
-				pending.push( assignAttributeAccessor( attributes[ gltfAttributeName ], gltfAttributeName.toLowerCase() ) );
-
-			}
+			pending.push( assignAttributeAccessor( attributes[ gltfAttributeName ], threeAttributeName ) );
 
 		}