Fix #120858: Flip Quaternions didn't use keyingset for autokeying

The issue was that the code called a function that doesn't
check for the active keyingset in combination with autokeying.
The fix is to just call `autokeyframe_pose_channel` which does that check.

I snuck in a minor change to the operator label.
It spells out "Quaternions" now instead of shortening to "Quats".
I haven't seen that way to shorten it in Blender before.

Pull Request: https://projects.blender.org/blender/blender/pulls/122170
This commit is contained in:
Christoph Lendenfeld
2024-05-28 11:58:46 +02:00
committed by Christoph Lendenfeld
parent c10de354ac
commit f3af98db5c

View File

@@ -794,7 +794,6 @@ void POSE_OT_reveal(wmOperatorType *ot)
static int pose_flip_quats_exec(bContext *C, wmOperator * /*op*/)
{
Scene *scene = CTX_data_scene(C);
KeyingSet *ks = ANIM_builtin_keyingset_get_named(ANIM_KS_LOC_ROT_SCALE_ID);
bool changed_multi = false;
@@ -810,7 +809,8 @@ static int pose_flip_quats_exec(bContext *C, wmOperator * /*op*/)
/* quaternions have 720 degree range */
negate_v4(pchan->quat);
blender::animrig::autokeyframe_pchan(C, scene, ob_iter, pchan, ks);
blender::animrig::autokeyframe_pose_channel(
C, scene, ob_iter, pchan, {{"rotation_quaternion"}}, false);
}
}
FOREACH_PCHAN_SELECTED_IN_OBJECT_END;
@@ -830,7 +830,7 @@ static int pose_flip_quats_exec(bContext *C, wmOperator * /*op*/)
void POSE_OT_quaternions_flip(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Flip Quats";
ot->name = "Flip Quaternions";
ot->idname = "POSE_OT_quaternions_flip";
ot->description =
"Flip quaternion values to achieve desired rotations, while maintaining the same "