浏览代码

allowing custom geometry attributes to be loaded from gltfs

Sneha Belkhale 6 年之前
父节点
当前提交
415b3371a2
共有 1 个文件被更改,包括 9 次插入3 次删除
  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 ];
 			var threeAttributeName = ATTRIBUTES[ gltfAttributeName ];
 
 
-			if ( ! threeAttributeName ) continue;
-
 			// Skip attributes already provided by e.g. Draco extension.
 			// Skip attributes already provided by e.g. Draco extension.
 			if ( threeAttributeName in geometry.attributes ) continue;
 			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() ) );
+
+			}
 
 
 		}
 		}