Bugfix for IK locked axes with an initial rotation, gave wrong

starting angle in some cases, but wasn't always noticeable due
to the IK solver changing it anyway.

Bugfix for hidden bones in pose mode still being active, and
preventing other bones from becoming active.
This commit is contained in:
Brecht Van Lommel 2007-12-06 19:44:17 +00:00
parent 51322964f4
commit 37d11907d0
2 changed files with 5 additions and 4 deletions

@ -61,11 +61,11 @@ static MT_Scalar EulerAngleFromMatrix(const MT_Matrix3x3& R, int axis)
MT_Scalar t = sqrt(R[0][0]*R[0][0] + R[0][1]*R[0][1]);
if (t > 16.0*MT_EPSILON) {
if (axis == 0) return atan2(R[1][2], R[2][2]);
if (axis == 0) return -atan2(R[1][2], R[2][2]);
else if(axis == 1) return atan2(-R[0][2], t);
else return atan2(R[0][1], R[0][0]);
else return -atan2(R[0][1], R[0][0]);
} else {
if (axis == 0) return atan2(-R[2][1], R[1][1]);
if (axis == 0) return -atan2(-R[2][1], R[1][1]);
else if(axis == 1) return atan2(-R[0][2], t);
else return 0.0f;
}

@ -2947,7 +2947,7 @@ static int hide_selected_pose_bone(Object *ob, Bone *bone, void *ptr)
if(arm->layer & bone->layer) {
if (bone->flag & BONE_SELECTED) {
bone->flag |= BONE_HIDDEN_P;
bone->flag &= ~BONE_SELECTED;
bone->flag &= ~(BONE_SELECTED|BONE_ACTIVE);
}
}
return 0;
@ -2977,6 +2977,7 @@ static int hide_unselected_pose_bone(Object *ob, Bone *bone, void *ptr)
if(arm->layer & bone->layer) {
if (~bone->flag & BONE_SELECTED) {
bone->flag |= BONE_HIDDEN_P;
bone->flag &= ~BONE_ACTIVE;
}
}
return 0;