diff --git a/examples/js/exporters/GLTFExporter.js b/examples/js/exporters/GLTFExporter.js index 8644def233fc088e81eb11edfee64f2c04e543c0..9bbdca54c3489d7d4727ad31cf81841cc8062b03 100644 --- a/examples/js/exporters/GLTFExporter.js +++ b/examples/js/exporters/GLTFExporter.js @@ -1162,6 +1162,9 @@ THREE.GLTFExporter.prototype = { var modifiedAttribute = null; for ( var attributeName in geometry.attributes ) { + // Ignore morph target attributes, which are exported later. + if ( attributeName.substr( 0, 5 ) === 'morph' ) continue; + var attribute = geometry.attributes[ attributeName ]; attributeName = nameConversion[ attributeName ] || attributeName.toUpperCase(); @@ -1194,15 +1197,11 @@ THREE.GLTFExporter.prototype = { } - if ( attributeName.substr( 0, 5 ) !== 'MORPH' ) { - - var accessor = processAccessor( modifiedAttribute || attribute, geometry ); - if ( accessor !== null ) { + var accessor = processAccessor( modifiedAttribute || attribute, geometry ); + if ( accessor !== null ) { - attributes[ attributeName ] = accessor; - cachedData.attributes.set( attribute, accessor ); - - } + attributes[ attributeName ] = accessor; + cachedData.attributes.set( attribute, accessor ); }