diff options
author | Joshua Leung <aligorith@gmail.com> | 2014-05-22 07:25:54 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2014-05-22 07:25:54 +0400 |
commit | 9e76f13e6b1b3c5f9760879ba3c026b491330b14 (patch) | |
tree | dc78f0be2fa8133fa7332ce1861a37eb9dd70456 /source | |
parent | 5bb615c41e12af9c47b4d7a9d356d3a3054470aa (diff) |
Fix T40304: Rearranging NLA Tracks (and actually, all animation channels) didn't work anymore
These were broken by 1f3655d224196129fc6daf20e678199b95321bff, since
an argument of the wrong type was getting passed to ANIM_animdata_filter(),
resulting in no channels ever being picked up for the "visible channels" list.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 2b85cae440e..eab78f19932 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -880,9 +880,23 @@ static void rearrange_animchannel_flatten_islands(ListBase *islands, ListBase *s static void rearrange_animchannels_filter_visible(ListBase *anim_data_visible, bAnimContext *ac, short type) { + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale, *ale_next; int filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS); - - ANIM_animdata_filter(ac, anim_data_visible, filter, ac->data, type); + + /* get all visible channels */ + ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + + /* now, only keep the ones that are of the types we are interested in */ + for (ale = anim_data.first; ale; ale = ale_next) { + ale_next = ale->next; + + if (ale->type != type) + BLI_freelinkN(&anim_data, ale); + } + + /* return cleaned up list */ + *anim_data_visible = anim_data; } /* performing rearranging of channels using islands */ @@ -950,10 +964,6 @@ static void rearrange_nla_channels(bAnimContext *ac, AnimData *adt, short mode) if (rearrange_func == NULL) return; - /* only consider NLA data if it's accessible */ - //if (EXPANDED_DRVD(adt) == 0) - // return; - /* Filter visible data. */ rearrange_animchannels_filter_visible(&anim_data_visible, ac, ANIMTYPE_NLATRACK); |