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:
authorCampbell Barton <ideasman42@gmail.com>2010-10-11 08:00:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-10-11 08:00:33 +0400
commitfab8deb811d0e3cd36b379fd795d3191282f7825 (patch)
treee09f0b6f629bb7965d628873927717be6147a435
parentdb4a205fa0343f03eae4020f1beb3dcea4469337 (diff)
bugfix [#20761] Bones/Armature: "Inherit Scale" doesn't work if "Inherit Rotation" is disabled
-rw-r--r--source/blender/blenkernel/intern/armature.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 2e760f53155..f1f9fe08717 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -2239,13 +2239,28 @@ void where_is_pose_bone(Scene *scene, Object *ob, bPoseChannel *pchan, float cti
offs_bone[3][1]+= parbone->length;
/* Compose the matrix for this bone */
- if(bone->flag & BONE_HINGE) { // uses restposition rotation, but actual position
+ if((bone->flag & BONE_HINGE) && (bone->flag & BONE_NO_SCALE)) { // uses restposition rotation, but actual position
float tmat[4][4];
-
/* the rotation of the parent restposition */
copy_m4_m4(tmat, parbone->arm_mat);
mul_serie_m4(pchan->pose_mat, tmat, offs_bone, pchan->chan_mat, NULL, NULL, NULL, NULL, NULL);
}
+ else if(bone->flag & BONE_HINGE) { // same as above but apply parent scale
+ float tmat[4][4];
+
+ /* apply the parent matrix scale */
+ float tsmat[4][4], tscale[3];
+
+ /* the rotation of the parent restposition */
+ copy_m4_m4(tmat, parbone->arm_mat);
+
+ /* extract the scale of the parent matrix */
+ mat4_to_size(tscale, parchan->pose_mat);
+ size_to_mat4(tsmat, tscale);
+ mul_m4_m4m4(tmat, tmat, tsmat);
+
+ mul_serie_m4(pchan->pose_mat, tmat, offs_bone, pchan->chan_mat, NULL, NULL, NULL, NULL, NULL);
+ }
else if(bone->flag & BONE_NO_SCALE) {
float orthmat[4][4];