Fix T76717: Set Rotation Mode Incorrectly Recalculates Bone Rotation In Pose Mode

The issue was that we didn't convert the current rotational values.
We simply just switched mode without doing any data conversions.
This commit is contained in:
Sebastian Parborg 2020-05-13 16:27:05 +02:00
parent 10528a5cd4
commit 25dea3e65e
Notes: blender-bot 2023-02-14 04:20:36 +01:00
Referenced by issue #76717, Set Rotation Mode Incorrectly Recalculates Bone Rotation In Pose Mode
1 changed files with 5 additions and 0 deletions

View File

@ -665,6 +665,11 @@ static int pose_bone_rotmode_exec(bContext *C, wmOperator *op)
/* set rotation mode of selected bones */
CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob) {
/* use API Method for conversions... */
BKE_rotMode_change_values(
pchan->quat, pchan->eul, pchan->rotAxis, &pchan->rotAngle, pchan->rotmode, (short)mode);
/* finally, set the new rotation type */
pchan->rotmode = mode;
if (prev_ob != ob) {