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:
Diffstat (limited to 'source/blender/blenkernel/intern/armature.c')
-rw-r--r--source/blender/blenkernel/intern/armature.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 3920f595514..6d01d9ff14b 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -594,7 +594,6 @@ static void pchan_b_bone_defmats(bPoseChannel *pchan, bPoseChanDeform *pdef_info
Mat4 b_bone[MAX_BBONE_SUBDIV], b_bone_rest[MAX_BBONE_SUBDIV];
Mat4 *b_bone_mats;
DualQuat *b_bone_dual_quats = NULL;
- float tmat[4][4] = MAT4_UNITY;
int a;
b_bone_spline_setup(pchan, 0, b_bone);
@@ -620,6 +619,8 @@ static void pchan_b_bone_defmats(bPoseChannel *pchan, bPoseChanDeform *pdef_info
* - transform back into global space */
for (a = 0; a < bone->segments; a++) {
+ float tmat[4][4];
+
invert_m4_m4(tmat, b_bone_rest[a].mat);
mul_serie_m4(b_bone_mats[a + 1].mat, pchan->chan_mat, bone->arm_mat, b_bone[a].mat, tmat, b_bone_mats[0].mat,
@@ -1108,10 +1109,11 @@ void BKE_armature_mat_world_to_pose(Object *ob, float inmat[4][4], float outmat[
* pose-channel into its local space (i.e. 'visual'-keyframing) */
void BKE_armature_loc_world_to_pose(Object *ob, const float inloc[3], float outloc[3])
{
- float xLocMat[4][4] = MAT4_UNITY;
+ float xLocMat[4][4];
float nLocMat[4][4];
/* build matrix for location */
+ unit_m4(xLocMat);
copy_v3_v3(xLocMat[3], inloc);
/* get bone-space cursor matrix and extract location */
@@ -1277,10 +1279,11 @@ void BKE_armature_mat_bone_to_pose(bPoseChannel *pchan, float inmat[4][4], float
* pose-channel into its local space (i.e. 'visual'-keyframing) */
void BKE_armature_loc_pose_to_bone(bPoseChannel *pchan, const float inloc[3], float outloc[3])
{
- float xLocMat[4][4] = MAT4_UNITY;
+ float xLocMat[4][4];
float nLocMat[4][4];
/* build matrix for location */
+ unit_m4(xLocMat);
copy_v3_v3(xLocMat[3], inloc);
/* get bone-space cursor matrix and extract location */