diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-11-30 17:57:22 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-11-30 18:30:44 +0300 |
commit | ed9b70393c47ecd5736c7d9ca3216e5306ca7b73 (patch) | |
tree | d6caaedf3690edd1acc2ced88ebfacf0ed354066 /source/blender | |
parent | 0f30edc20c6206b40216b162fa435d23562127f8 (diff) |
Cleanup: Animation, clean up action group rearranging code
Some minor cleanups to make an upcoming bugfix easier.
No functional changes.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 6c3018749f7..4c17d84b200 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -1205,7 +1205,6 @@ static void rearrange_driver_channels(bAnimContext *ac, /* make sure all action-channels belong to a group (and clear action's list) */ static void split_groups_action_temp(bAction *act, bActionGroup *tgrp) { - bActionGroup *agrp; FCurve *fcu; if (act == NULL) { @@ -1213,7 +1212,7 @@ static void split_groups_action_temp(bAction *act, bActionGroup *tgrp) } /* Separate F-Curves into lists per group */ - for (agrp = act->groups.first; agrp; agrp = agrp->next) { + LISTBASE_FOREACH (bActionGroup *, agrp, &act->groups) { if (agrp->channels.first) { fcu = agrp->channels.last; act->curves.first = fcu->next; @@ -1263,12 +1262,10 @@ static void join_groups_action_temp(bAction *act) bActionGroup *agrp; for (agrp = act->groups.first; agrp; agrp = agrp->next) { - ListBase tempGroup; - /* add list of channels to action's channels */ - tempGroup = agrp->channels; + const ListBase group_channels = agrp->channels; BLI_movelisttolist(&act->curves, &agrp->channels); - agrp->channels = tempGroup; + agrp->channels = group_channels; /* clear moved flag */ agrp->flag &= ~AGRP_MOVED; @@ -1278,9 +1275,7 @@ static void join_groups_action_temp(bAction *act) * - remove from list (but don't free as it's on the stack!) */ if (agrp->flag & AGRP_TEMP) { - FCurve *fcu; - - for (fcu = agrp->channels.first; fcu; fcu = fcu->next) { + LISTBASE_FOREACH (FCurve *, fcu, &agrp->channels) { fcu->grp = NULL; } |