diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2011-08-31 13:37:14 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2011-08-31 13:37:14 +0400 |
commit | d0d82c69e96e96845a59ad625900a94187dac621 (patch) | |
tree | adce3e9320aa0531c4f889966aa2875ff3a5e536 /source/blender/collada/ArmatureImporter.cpp | |
parent | f63d049adc268bc71ac87c2b781e2f44f60da1f5 (diff) |
COLLADA: Take parent bone length and direction instead of using bone pointing up with length 1. Looks much nicer and less confusing on larger armatures now.
Diffstat (limited to 'source/blender/collada/ArmatureImporter.cpp')
-rw-r--r-- | source/blender/collada/ArmatureImporter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp index 1e7879b352f..2ec8ae540d2 100644 --- a/source/blender/collada/ArmatureImporter.cpp +++ b/source/blender/collada/ArmatureImporter.cpp @@ -310,9 +310,10 @@ void ArmatureImporter::fix_leaf_bones( ) LeafBone& leaf = *it; // pointing up - float vec[3] = {0.0f, 0.0f, 1.0f}; + float vec[3] = {0.0f, 0.0f, 0.1f}; - //mul_v3_fl(vec, leaf_bone_length); + // if parent: take parent length and direction + if(leaf.bone->parent) sub_v3_v3v3(vec, leaf.bone->parent->tail, leaf.bone->parent->head); copy_v3_v3(leaf.bone->tail, leaf.bone->head); add_v3_v3v3(leaf.bone->tail, leaf.bone->head, vec); |