diff options
author | Juha Mäki-Kanto <ih5235252@gmail.com> | 2012-02-25 01:45:59 +0400 |
---|---|---|
committer | Juha Mäki-Kanto <ih5235252@gmail.com> | 2012-02-25 01:45:59 +0400 |
commit | 2d8227f20400767bcf0fbb0877a055534d8a99ff (patch) | |
tree | c5325cd22ecf979438eeeff320a62c61f650187e /source/blender/collada/ArmatureExporter.cpp | |
parent | adba42beaaa941303592cf866525d606b8c0cc62 (diff) |
Collada export: bone parenting is actually against the tail.
Don't know the reasoning for having it be against the tail and not the head.
Diffstat (limited to 'source/blender/collada/ArmatureExporter.cpp')
-rw-r--r-- | source/blender/collada/ArmatureExporter.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp index 9399ce6771d..47d41a9680f 100644 --- a/source/blender/collada/ArmatureExporter.cpp +++ b/source/blender/collada/ArmatureExporter.cpp @@ -196,33 +196,34 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene* sce, if((*i)->partype == PARBONE && (0 == strcmp((*i)->parsubstr, bone->name))) { float backup_parinv[4][4]; + copy_m4_m4(backup_parinv, (*i)->parentinv); - // SECOND_LIFE_COMPATIBILITY // crude, temporary change to parentinv // so transform gets exported correctly. + + // Add bone tail- translation... don't know why + // bone parenting is against the tail of a bone + // and not it's head, seems arbitrary. + (*i)->parentinv[3][1] += bone->length; + + // SECOND_LIFE_COMPATIBILITY // TODO: when such objects are animated as // single matrix the tweak must be applied // to the result. if(export_settings->second_life) { - copy_m4_m4(backup_parinv, (*i)->parentinv); - // tweak objects parentinverse to match - // the second life- compatibility + // tweak objects parentinverse to match compatibility float temp[4][4]; copy_m4_m4(temp, bone->arm_mat); temp[3][0] = temp[3][1] = temp[3][2] = 0.0f; - mult_m4_m4m4((*i)->parentinv, temp, backup_parinv); + mult_m4_m4m4((*i)->parentinv, temp, (*i)->parentinv); } se->writeNodes(*i, sce); - // restore original parentinv - if(export_settings->second_life) - { - copy_m4_m4((*i)->parentinv, backup_parinv); - } + copy_m4_m4((*i)->parentinv, backup_parinv); child_objects.erase(i++); } else i++; |