diff options
author | Domino Marama <domino@dominodesigns.info> | 2012-02-05 20:19:28 +0400 |
---|---|---|
committer | Domino Marama <domino@dominodesigns.info> | 2012-02-05 20:19:28 +0400 |
commit | 2cb3fe3dfd830386633e5642d35108be8b6b6a17 (patch) | |
tree | 9fde457bc9f80d5be215c1bd7c130bca6f0dccc9 /source/blender/collada/AnimationExporter.cpp | |
parent | fa163003c98e09f00bcbbee7838d5ed487d55cc8 (diff) |
Patch #30050 by Juha Mäki-Kanto (kanttori)
Fixes for Collada exporter.
Adds Second Life compatibility for armatures
Adds objects parentinverse to exported transform if it's non-identity
Fix mismatch between add_inv_bind_mats and add_joints_source accessor counts
Fix bone exports in world space should be local space
Diffstat (limited to 'source/blender/collada/AnimationExporter.cpp')
-rw-r--r-- | source/blender/collada/AnimationExporter.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index 7b57ed243a1..c2d8c356aae 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -773,6 +773,27 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames , Ob copy_m4_m4(mat, pchan->pose_mat); UnitConverter converter; + // SECOND_LIFE_COMPATIBILITY + // AFAIK animation to second life is via BVH, but no + // reason to not have the collada-animation be correct + if(export_settings->second_life) + { + float temp[4][4]; + copy_m4_m4(temp, bone->arm_mat); + temp[3][0] = temp[3][1] = temp[3][2] = 0.0f; + invert_m4(temp); + + mult_m4_m4m4(mat, mat, temp); + + if(bone->parent) + { + copy_m4_m4(temp, bone->parent->arm_mat); + temp[3][0] = temp[3][1] = temp[3][2] = 0.0f; + + mult_m4_m4m4(mat, temp, mat); + } + } + float outmat[4][4]; converter.mat4_to_dae(outmat,mat); |