Action Editor - Group drawing tweaks:
* When all the action-channels for a group are hidden (i.e. their related bones are not visible), the group in question is also not drawn. This helps reduce clutter. (slikdigit funboard request) * When a group has no channels belonging to it, the expand icon/button isn't drawn for that group.
This commit is contained in:
parent
e27d635e18
commit
13e4ae1542
@ -474,10 +474,13 @@ static void draw_channel_names(void)
|
||||
indent= 0;
|
||||
special= -1;
|
||||
|
||||
if (EXPANDED_AGRP(agrp))
|
||||
expand = ICON_TRIA_DOWN;
|
||||
else
|
||||
expand = ICON_TRIA_RIGHT;
|
||||
/* only show expand if there are any channels */
|
||||
if (agrp->channels.first) {
|
||||
if (EXPANDED_AGRP(agrp))
|
||||
expand = ICON_TRIA_DOWN;
|
||||
else
|
||||
expand = ICON_TRIA_RIGHT;
|
||||
}
|
||||
|
||||
if (EDITABLE_AGRP(agrp))
|
||||
protect = ICON_UNLOCKED;
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user