Browse Source

allowing custom geometry attributes to be loaded from gltfs

Sneha Belkhale 6 years ago
parent
commit
415b3371a2
1 changed files with 9 additions and 3 deletions
  1. 9 3
      examples/js/loaders/GLTFLoader.js

+ 9 - 3
examples/js/loaders/GLTFLoader.js

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