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_action/action_edit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/space_action/action_edit.c') diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 2ac10736eea..e97b666810c 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -730,7 +730,7 @@ static void insert_gpencil_key(bAnimContext *ac, Scene *scene = ac->scene; bGPdata *gpd = (bGPdata *)ale->id; bGPDlayer *gpl = (bGPDlayer *)ale->data; - BKE_gpencil_layer_frame_get(gpl, CFRA, add_frame_mode); + BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, add_frame_mode); /* Check if the gpd changes to tag only once. */ if (gpd != *gpd_old) { BKE_gpencil_tag(gpd); @@ -827,8 +827,8 @@ static void insert_action_keys(bAnimContext *ac, short mode) } /* insert keyframes */ - const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct(ac->depsgraph, - (float)CFRA); + const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct( + ac->depsgraph, (float)scene->r.cfra); for (ale = anim_data.first; ale; ale = ale->next) { switch (ale->type) { case ANIMTYPE_GPLAYER: @@ -1696,8 +1696,8 @@ static int actkeys_framejump_exec(bContext *C, wmOperator *UNUSED(op)) /* set the new current frame value, based on the average time */ if (ked.i1) { Scene *scene = ac.scene; - CFRA = round_fl_to_int(ked.f1 / ked.i1); - SUBFRA = 0.0f; + scene->r.cfra = round_fl_to_int(ked.f1 / ked.i1); + scene->r.subframe = 0.0f; } /* set notifier that things have changed */ -- cgit v1.2.3