Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2008-06-29 09:52:11 +0400
committerJoshua Leung <aligorith@gmail.com>2008-06-29 09:52:11 +0400
commit13e4ae15428cc5f05d114ec522953e6cf06b4dbb (patch)
tree18786b895d3f1302130b1cc6ea64e60d51fd0d87 /source/blender/src
parente27d635e186d6d8bb10a2efd5c43bbc76caff70f (diff)
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.
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/drawaction.c11
-rw-r--r--source/blender/src/editaction.c13
2 files changed, 18 insertions, 6 deletions
diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c
index 8c4958a651a..89466151a39 100644
--- a/source/blender/src/drawaction.c
+++ b/source/blender/src/drawaction.c
@@ -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;
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;
}