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_graph/graph_select.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/space_graph/graph_select.c') diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 70f9e4a60d9..a36bd5c1461 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -1209,7 +1209,7 @@ static void columnselect_graph_keys(bAnimContext *ac, short mode) ce = MEM_callocN(sizeof(CfraElem), "cfraElem"); BLI_addtail(&ked.list, ce); - ce->cfra = (float)CFRA; + ce->cfra = (float)scene->r.cfra; break; case GRAPHKEYS_COLUMNSEL_MARKERS_COLUMN: /* list of selected markers */ @@ -1521,10 +1521,10 @@ static void graphkeys_select_leftright(bAnimContext *ac, short leftright, short if (leftright == GRAPHKEYS_LRSEL_LEFT) { ked.f1 = MINAFRAMEF; - ked.f2 = (float)(CFRA + 0.1f); + ked.f2 = (float)(scene->r.cfra + 0.1f); } else { - ked.f1 = (float)(CFRA - 0.1f); + ked.f1 = (float)(scene->r.cfra - 0.1f); ked.f2 = MAXFRAMEF; } @@ -1605,7 +1605,7 @@ static int graphkeys_select_leftright_invoke(bContext *C, wmOperator *op, const /* determine which side of the current frame mouse is on */ x = UI_view2d_region_to_view_x(v2d, event->mval[0]); - if (x < CFRA) { + if (x < scene->r.cfra) { RNA_enum_set(op->ptr, "mode", GRAPHKEYS_LRSEL_LEFT); } else { -- cgit v1.2.3