提交 268c22fc 编写于 作者: T Takahiro

GLTFExporter: Morph Target weights support

上级 a885290f
...@@ -792,6 +792,7 @@ THREE.GLTFExporter.prototype = { ...@@ -792,6 +792,7 @@ THREE.GLTFExporter.prototype = {
// Morph targets // Morph targets
if ( mesh.morphTargetInfluences !== undefined && mesh.morphTargetInfluences.length > 0 ) { if ( mesh.morphTargetInfluences !== undefined && mesh.morphTargetInfluences.length > 0 ) {
var weights = [];
gltfMesh.primitives[ 0 ].targets = []; gltfMesh.primitives[ 0 ].targets = [];
for ( var i = 0; i < mesh.morphTargetInfluences.length; ++ i ) { for ( var i = 0; i < mesh.morphTargetInfluences.length; ++ i ) {
...@@ -808,8 +809,12 @@ THREE.GLTFExporter.prototype = { ...@@ -808,8 +809,12 @@ THREE.GLTFExporter.prototype = {
gltfMesh.primitives[ 0 ].targets.push( target ); gltfMesh.primitives[ 0 ].targets.push( target );
weights.push( mesh.morphTargetInfluences[ i ] );
} }
gltfMesh.weights = weights;
} }
outputJSON.meshes.push( gltfMesh ); outputJSON.meshes.push( gltfMesh );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册