diff options
author | Julian Eisel <julian@blender.org> | 2022-06-30 19:36:42 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-06-30 19:38:44 +0300 |
commit | 65166e145b4d6292abc289b71894c53b25c186ba (patch) | |
tree | 707513038d00a964d7a400ac8e7e22251fffb02d /source/blender/editors/screen | |
parent | 66de653784ab06ccea46413de6b2f086b5a69d30 (diff) |
Cleanup: Remove scene frame macros (`CFRA` et al.)
Removes the following macros for scene/render frame values:
- `CFRA`
- `SUBFRA`
- `SFRA`
- `EFRA`
These macros don't add much, other than saving a few characters when typing.
It's not immediately clear what they refer to, they just hide what they
actually access. Just be explicit and clear about that.
Plus these macros gave read and write access to the variables, so eyesores like
this would be done (eyesore because it looks like assigning to a constant):
```
CFRA = some_frame_nbr;
```
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D15311
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index d35bd5ab2fe..c616ca2b5eb 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2951,9 +2951,9 @@ static int frame_offset_exec(bContext *C, wmOperator *op) int delta = RNA_int_get(op->ptr, "delta"); - CFRA += delta; - FRAMENUMBER_MIN_CLAMP(CFRA); - SUBFRA = 0.0f; + scene->r.cfra += delta; + FRAMENUMBER_MIN_CLAMP(scene->r.cfra); + scene->r.subframe = 0.0f; areas_do_frame_follow(C, false); @@ -2992,7 +2992,7 @@ static int frame_jump_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); wmTimer *animtimer = CTX_wm_screen(C)->animtimer; - /* Don't change CFRA directly if animtimer is running as this can cause + /* Don't change scene->r.cfra directly if animtimer is running as this can cause * first/last frame not to be actually shown (bad since for example physics * simulations aren't reset properly). */ @@ -3010,10 +3010,10 @@ static int frame_jump_exec(bContext *C, wmOperator *op) } else { if (RNA_boolean_get(op->ptr, "end")) { - CFRA = PEFRA; + scene->r.cfra = PEFRA; } else { - CFRA = PSFRA; + scene->r.cfra = PSFRA; } areas_do_frame_follow(C, true); @@ -3062,7 +3062,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - float cfra = (float)(CFRA); + float cfra = (float)(scene->r.cfra); /* Initialize binary-tree-list for getting keyframes. */ struct AnimKeylist *keylist = ED_keylist_create(); @@ -3104,9 +3104,9 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op) } while ((ak != NULL) && (done == false)) { - if (CFRA != (int)ak->cfra) { + if (scene->r.cfra != (int)ak->cfra) { /* this changes the frame, so set the frame and we're done */ - CFRA = (int)ak->cfra; + scene->r.cfra = (int)ak->cfra; done = true; } else { @@ -3165,20 +3165,20 @@ static void SCREEN_OT_keyframe_jump(wmOperatorType *ot) static int marker_jump_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - int closest = CFRA; + int closest = scene->r.cfra; const bool next = RNA_boolean_get(op->ptr, "next"); bool found = false; /* find matching marker in the right direction */ LISTBASE_FOREACH (TimeMarker *, marker, &scene->markers) { if (next) { - if ((marker->frame > CFRA) && (!found || closest > marker->frame)) { + if ((marker->frame > scene->r.cfra) && (!found || closest > marker->frame)) { closest = marker->frame; found = true; } } else { - if ((marker->frame < CFRA) && (!found || closest < marker->frame)) { + if ((marker->frame < scene->r.cfra) && (!found || closest < marker->frame)) { closest = marker->frame; found = true; } @@ -3192,7 +3192,7 @@ static int marker_jump_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - CFRA = closest; + scene->r.cfra = closest; areas_do_frame_follow(C, true); @@ -4714,7 +4714,7 @@ static int screen_animation_step_invoke(bContext *C, wmOperator *UNUSED(op), con if (sad->flag & ANIMPLAY_FLAG_JUMPED) { DEG_id_tag_update(&scene->id, ID_RECALC_FRAME_CHANGE); #ifdef PROFILE_AUDIO_SYNCH - old_frame = CFRA; + old_frame = scene->r.cfra; #endif } |