Browse Source

Merge pull request #14218 from takahirox/GLTFExporterSkipSingleMorphAnimation

GLTFExporter: Skip single morph animation.
Mr.doob 7 years ago
parent
commit
0b340e7e5e
1 changed files with 10 additions and 0 deletions
  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;
 
 				}