Fix T99400: "Jump to Keyframe" preserves subframe offset

Previously when using the "Jump To Keyframe" operator
in conjunction with subframes, the decimal part would be kept.
Meaning that it wouldn't jump exactly to the frame.
This fix also makes it so it is possible to jump to keyframes
that are on subframes.

Reviewed by: Sybren
Differential Revision: https://developer.blender.org/D16595
This commit is contained in:
Christoph Lendenfeld 2022-11-24 15:19:48 +01:00
parent 17e562311f
commit 705fe08b61
Notes: blender-bot 2023-02-14 08:45:12 +01:00
Referenced by issue #99400, "Jump to Keyframe" preserves subframe offset
4 changed files with 6 additions and 4 deletions

@ -1 +1 @@
Subproject commit fe221a8bc934385d9f302c46a5c7cbeacddafe3b
Subproject commit ef57e2c2c65933a68811d58b40ed62b775e9b4b0

@ -1 +1 @@
Subproject commit 5a818af95080cccf04dfa8317f0e966bff515c64
Subproject commit 946b62da3f9c93b4add8596aef836bf3a29ea27c

@ -1 +1 @@
Subproject commit c43c0b2bcf08c34d933c3b56f096c9a23c8eff68
Subproject commit 69b1305f4b74fbd7e847acc6a5566755b9803d78

View File

@ -3106,7 +3106,9 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
while ((ak != NULL) && (done == false)) {
if (scene->r.cfra != (int)ak->cfra) {
/* this changes the frame, so set the frame and we're done */
scene->r.cfra = (int)ak->cfra;
const int whole_frame = (int)ak->cfra;
scene->r.cfra = whole_frame;
scene->r.subframe = ak->cfra - whole_frame;
done = true;
}
else {