From 78d1aa4d521cff25b07af2f6f8790d51b8b26064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 13 Oct 2020 14:43:19 +0200 Subject: Cleanup: Animation, simplify channel selection code Split up `ANIM_deselect_anim_channels()` into `ANIM_anim_channels_select_set()` and `ANIM_anim_channels_select_toggle()`. `ANIM_anim_channels_select_set()` is equivalent to the old `ANIM_deselect_anim_channels(..., false, ACHANNEL_SETFLAG_xxx)`. `ANIM_anim_channels_select_toggle()` is equivalent to the old `ANIM_deselect_anim_channels(..., true, ACHANNEL_SETFLAG_ADD)`. `ANIM_deselect_anim_channels(..., true, ACHANNEL_SETFLAG_CLEAR)` was also called once. The `true` parameter suggested the "toggle" behaviour was intended, but the `ACHANNEL_SETFLAG_CLEAR` argument prevented any toggling. This is now replaced with `ANIM_anim_channels_select_set(ac, ACHANNEL_SETFLAG_CLEAR)` to make this explicit. No functional changes, just a cleanup in order to better understand how the selection works. --- source/blender/editors/space_nla/nla_channels.c | 6 +++--- source/blender/editors/space_nla/nla_select.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/space_nla') diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index fbda0ff7bde..561de5e82a6 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -204,7 +204,7 @@ static int mouse_nla_channels( } else { /* select AnimData block by itself */ - ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR); + ANIM_anim_channels_select_set(ac, ACHANNEL_SETFLAG_CLEAR); ale->adt->flag |= ADT_UI_SELECTED; } @@ -267,7 +267,7 @@ static int mouse_nla_channels( } else { /* select F-Curve by itself */ - ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR); + ANIM_anim_channels_select_set(ac, ACHANNEL_SETFLAG_CLEAR); nlt->flag |= NLATRACK_SELECTED; } @@ -329,7 +329,7 @@ static int mouse_nla_channels( } else { /* select AnimData block by itself */ - ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR); + ANIM_anim_channels_select_set(ac, ACHANNEL_SETFLAG_CLEAR); adt->flag |= ADT_UI_SELECTED; } diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 74e5f1cfdd0..751a05b605e 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -638,7 +638,7 @@ static int mouse_nla_strips(bContext *C, deselect_nla_strips(ac, 0, SELECT_SUBTRACT); /* deselect all other channels first */ - ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR); + ANIM_anim_channels_select_set(ac, ACHANNEL_SETFLAG_CLEAR); } } -- cgit v1.2.3