From 65166e145b4d6292abc289b71894c53b25c186ba Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Thu, 30 Jun 2022 18:36:42 +0200 Subject: 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 --- source/blender/editors/space_clip/clip_ops.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/space_clip/clip_ops.c') diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index f5bf850791a..f276c2acd1a 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -1061,9 +1061,9 @@ static void change_frame_apply(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); /* set the new frame number */ - CFRA = RNA_int_get(op->ptr, "frame"); - FRAMENUMBER_MIN_CLAMP(CFRA); - SUBFRA = 0.0f; + scene->r.cfra = RNA_int_get(op->ptr, "frame"); + FRAMENUMBER_MIN_CLAMP(scene->r.cfra); + scene->r.subframe = 0.0f; /* do updates */ DEG_id_tag_update(&scene->id, ID_RECALC_FRAME_CHANGE); @@ -1084,7 +1084,7 @@ static int frame_from_event(bContext *C, const wmEvent *event) int framenr = 0; if (region->regiontype == RGN_TYPE_WINDOW) { - float sfra = SFRA, efra = EFRA, framelen = region->winx / (efra - sfra + 1); + float sfra = scene->r.sfra, efra = scene->r.efra, framelen = region->winx / (efra - sfra + 1); framenr = sfra + event->mval[0] / framelen; } @@ -1399,7 +1399,7 @@ static void do_sequence_proxy(void *pjv, ProxyJob *pj = pjv; MovieClip *clip = pj->clip; Scene *scene = pj->scene; - int sfra = SFRA, efra = EFRA; + int sfra = scene->r.sfra, efra = scene->r.efra; ProxyThread *handles; int tot_thread = BLI_task_scheduler_num_threads(); int width, height; -- cgit v1.2.3