From 268c22fc5b7b24591fa16a92a62de02834c2ef49 Mon Sep 17 00:00:00 2001 From: Takahiro Date: Tue, 23 Jan 2018 11:20:27 +0900 Subject: [PATCH] GLTFExporter: Morph Target weights support --- examples/js/exporters/GLTFExporter.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/js/exporters/GLTFExporter.js b/examples/js/exporters/GLTFExporter.js index 642d2042fb..68b97a8ddf 100644 --- a/examples/js/exporters/GLTFExporter.js +++ b/examples/js/exporters/GLTFExporter.js @@ -792,6 +792,7 @@ THREE.GLTFExporter.prototype = { // Morph targets if ( mesh.morphTargetInfluences !== undefined && mesh.morphTargetInfluences.length > 0 ) { + var weights = []; gltfMesh.primitives[ 0 ].targets = []; for ( var i = 0; i < mesh.morphTargetInfluences.length; ++ i ) { @@ -808,8 +809,12 @@ THREE.GLTFExporter.prototype = { gltfMesh.primitives[ 0 ].targets.push( target ); + weights.push( mesh.morphTargetInfluences[ i ] ); + } + gltfMesh.weights = weights; + } outputJSON.meshes.push( gltfMesh ); -- GitLab