diff options
Diffstat (limited to 'source/blender/src/editaction.c')
-rw-r--r-- | source/blender/src/editaction.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index 40b6b7ba6fe..f93a1526e3c 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -390,7 +390,7 @@ static void actdata_filter_actionchannel (ListBase *act_data, bActionChannel *ac static void actdata_filter_action (ListBase *act_data, bAction *act, int filter_mode) { - bActListElem *ale; + bActListElem *ale=NULL; bActionGroup *agrp; bActionChannel *achan, *lastchan=NULL; @@ -429,6 +429,15 @@ static void actdata_filter_action (ListBase *act_data, bAction *act, int filter_ for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) { actdata_filter_actionchannel(act_data, achan, filter_mode); } + + /* remove group from filtered list if last element is group + * (i.e. only if group had channels, which were all hidden) + */ + if ( (ale) && (act_data->last == ale) && + (ale->data == agrp) && (agrp->channels.first) ) + { + BLI_freelinkN(act_data, ale); + } } } } @@ -3648,7 +3657,7 @@ static void mouse_actionchannels (short mval[]) { bActionGroup *agrp= (bActionGroup *)act_channel; - if (mval[0] < 16) { + if ((mval[0] < 16) && (agrp->channels.first)) { /* toggle expand */ agrp->flag ^= AGRP_EXPANDED; } |