Fix T40304: Rearranging NLA Tracks (and actually, all animation channels) didn't work anymore
These were broken by 1f3655d224
, 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.
This commit is contained in:
parent
5bb615c41e
commit
9e76f13e6b
Notes:
blender-bot
2023-02-14 11:21:40 +01:00
Referenced by issue #40304, PgUp and PgDn no longer work to move NLA tracks up and down
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue