Explorar o código

Merge pull request #14218 from takahirox/GLTFExporterSkipSingleMorphAnimation

GLTFExporter: Skip single morph animation.
Mr.doob %!s(int64=7) %!d(string=hai) anos
pai
achega
0b340e7e5e
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  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;
 
 				}