[Bf-blender-cvs] [25dea3e65ef] blender-v2.83-release: Fix T76717: Set Rotation Mode Incorrectly Recalculates Bone Rotation In Pose Mode

Sebastian Parborg noreply at git.blender.org
Tue May 19 12:23:45 CEST 2020


Commit: 25dea3e65efd64566d0b6397094fa76ec4ef089d
Author: Sebastian Parborg
Date:   Wed May 13 16:27:05 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB25dea3e65efd64566d0b6397094fa76ec4ef089d

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.

===================================================================

M	source/blender/editors/armature/pose_edit.c

===================================================================

diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index c5b9f6adb28..0cd3afc9cf9 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -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) {



More information about the Bf-blender-cvs mailing list