浏览代码

GLTFExporter: Fix morph target export bugs.

Don McCurdy 6 年之前
父节点
当前提交
4b93acc9e1
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      examples/js/exporters/GLTFExporter.js

+ 4 - 4
examples/js/exporters/GLTFExporter.js

@@ -1192,9 +1192,9 @@ THREE.GLTFExporter.prototype = {
 
 
 						var baseAttribute = geometry.attributes[ attributeName ];
 						var baseAttribute = geometry.attributes[ attributeName ];
 
 
-						if ( cachedData.attributes.has( baseAttribute ) ) {
+						if ( cachedData.attributes.has( attribute ) ) {
 
 
-							target[ gltfAttributeName ] = cachedData.attributes.get( baseAttribute );
+							target[ gltfAttributeName ] = cachedData.attributes.get( attribute );
 							continue;
 							continue;
 
 
 						}
 						}
@@ -1999,9 +1999,9 @@ THREE.GLTFExporter.Utils = {
 			var sourceTrackBinding = THREE.PropertyBinding.parseTrackName( sourceTrack.name );
 			var sourceTrackBinding = THREE.PropertyBinding.parseTrackName( sourceTrack.name );
 			var sourceTrackNode = THREE.PropertyBinding.findNode( root, sourceTrackBinding.nodeName );
 			var sourceTrackNode = THREE.PropertyBinding.findNode( root, sourceTrackBinding.nodeName );
 
 
-			if ( sourceTrackBinding.propertyName !== 'morphTargetInfluences' ) {
+			if ( sourceTrackBinding.propertyName !== 'morphTargetInfluences' || sourceTrackBinding.propertyIndex === undefined ) {
 
 
-				// Tracks that don't affect morph targets can be kept as-is.
+				// Tracks that don't affect morph targets, or that affect all morph targets together, can be left as-is.
 				tracks.push( sourceTrack );
 				tracks.push( sourceTrack );
 				continue;
 				continue;