[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39820] trunk/blender/source/blender/ collada/ArmatureImporter.cpp: COLLADA: Take parent bone length and direction instead of using bone pointing up with length 1 .
Nathan Letwory
nathan at letworyinteractive.com
Wed Aug 31 11:37:15 CEST 2011
Revision: 39820
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39820
Author: jesterking
Date: 2011-08-31 09:37:14 +0000 (Wed, 31 Aug 2011)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/blender/collada/ArmatureImporter.cpp
Modified: trunk/blender/source/blender/collada/ArmatureImporter.cpp
===================================================================
--- trunk/blender/source/blender/collada/ArmatureImporter.cpp 2011-08-31 07:31:02 UTC (rev 39819)
+++ trunk/blender/source/blender/collada/ArmatureImporter.cpp 2011-08-31 09:37:14 UTC (rev 39820)
@@ -310,9 +310,10 @@
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);
More information about the Bf-blender-cvs
mailing list