forked from bartvdbraak/blender
bugfix [#20761] Bones/Armature: "Inherit Scale" doesn't work if "Inherit Rotation" is disabled
This commit is contained in:
parent
db4a205fa0
commit
fab8deb811
@ -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];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user