ソースを参照

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;
 
 				}