Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaia Clary <gaia.clary@machinimatrix.org>2013-07-27 02:19:46 +0400
committerGaia Clary <gaia.clary@machinimatrix.org>2013-07-27 02:19:46 +0400
commit91fc92794c4d36c1d095ac6d0f9a5a4d3bdf66e8 (patch)
treedb58b515a8245b55a4bbdba5084a4f9926d2e5a7 /source/blender/collada/ArmatureImporter.cpp
parentbc84a50c13bfcc6fa955e7d10b00bd97559b36cd (diff)
Import of single bones used infinite bone size
Diffstat (limited to 'source/blender/collada/ArmatureImporter.cpp')
-rw-r--r--source/blender/collada/ArmatureImporter.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp
index eb92b089f48..c1ba40d95f9 100644
--- a/source/blender/collada/ArmatureImporter.cpp
+++ b/source/blender/collada/ArmatureImporter.cpp
@@ -204,16 +204,21 @@ void ArmatureImporter::add_leaf_bone(float mat[4][4], EditBone *bone, COLLADAFW
void ArmatureImporter::fix_leaf_bones( )
{
+ // Collada only knows Joints, Here we guess a reasonable
+ // leaf bone length
+ float leaf_length = (leaf_bone_length == FLT_MAX) ? 1.0:leaf_bone_length;
+
// just setting tail for leaf bones here
std::vector<LeafBone>::iterator it;
for (it = leaf_bones.begin(); it != leaf_bones.end(); it++) {
+
LeafBone& leaf = *it;
// pointing up
float vec[3] = {0.0f, 0.0f, 0.1f};
sub_v3_v3v3(vec, leaf.bone->tail , leaf.bone->head);
- mul_v3_fl(vec, leaf_bone_length);
+ mul_v3_fl(vec, leaf_length);
add_v3_v3v3(leaf.bone->tail, leaf.bone->head , vec);
}