浏览代码

GLTFExporter: Skip single morph animation.

Takahiro 7 年之前
父节点
当前提交
0a2c56f3c4
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      examples/js/exporters/GLTFExporter.js

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

@@ -1378,6 +1378,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" because ' +
+							'glTF can not handle single morph animation. ' +
+							'Try to merge .morphTargetInfluences elements instead.', track.name );
+						continue;
+
+					}
+
 					outputItemSize /= trackNode.morphTargetInfluences.length;
 
 				}