소스 검색

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