diff options
author | Joshua Leung <aligorith@gmail.com> | 2014-05-22 07:37:32 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2014-05-22 07:37:32 +0400 |
commit | 6f99699d7d5a362e669b86cee6487e1397b017ba (patch) | |
tree | 60c03c5d5d5412042cb7bc0a00229253167debb1 /source/blender/editors/animation | |
parent | 9e76f13e6b1b3c5f9760879ba3c026b491330b14 (diff) |
Previous commit uncovered another bug - Ungrouped FCurves couldn't be rearranged still
This was because to the filtering code, those FCurves still weren't in any
groups, and so couldn't be visible (since a temporary group is created to
house them). As a result, the visible-channels list would be empty, causing
all hidden FCurves to be treated as hidden.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index eab78f19932..a7e7cb2df1a 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -891,8 +891,9 @@ static void rearrange_animchannels_filter_visible(ListBase *anim_data_visible, b for (ale = anim_data.first; ale; ale = ale_next) { ale_next = ale->next; - if (ale->type != type) + if (ale->type != type) { BLI_freelinkN(&anim_data, ale); + } } /* return cleaned up list */ @@ -1045,6 +1046,13 @@ static void split_groups_action_temp(bAction *act, bActionGroup *tgrp) fcu->next = NULL; tgrp->channels.last = fcu; act->curves.last = NULL; + + /* ensure that all of these get their group set to this temp group + * (so that visibility filtering works) + */ + for (fcu = tgrp->channels.first; fcu; fcu = fcu->next) { + fcu->grp = tgrp; + } } /* Add temp-group to list */ @@ -1067,8 +1075,17 @@ static void join_groups_action_temp(bAction *act) /* clear moved flag */ agrp->flag &= ~AGRP_MOVED; - /* if temp-group... remove from list (but don't free as it's on the stack!) */ + /* if group was temporary one: + * - unassign all FCurves which were temporarily added to it + * - 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) { + fcu->grp = NULL; + } + BLI_remlink(&act->groups, agrp); break; } |