浏览代码

Merge pull request #14218 from takahirox/GLTFExporterSkipSingleMorphAnimation

GLTFExporter: Skip single morph animation.
Mr.doob 7 年之前
父节点
当前提交
0b340e7e5e
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      examples/js/exporters/GLTFExporter.js

+ 10 - 0
examples/js/exporters/GLTFExporter.js

@@ -1397,6 +1397,16 @@ THREE.GLTFExporter.prototype = {
 
 				if ( trackProperty === PATH_PROPERTIES.morphTargetInfluences ) {
 
+					if ( trackNode.morphTargetInfluences.length !== 1 &&
+						trackBinding.propertyIndex !== undefined ) {
+
+						console.warn( 'THREE.GLTFExporter: Skipping animation track "%s". ' +
+							'Morph target keyframe tracks must target all available morph targets ' +
+							'for the given mesh.', track.name );
+						continue;
+
+					}
+
 					outputItemSize /= trackNode.morphTargetInfluences.length;
 
 				}