diff options
author | Joshua Leung <aligorith@gmail.com> | 2017-01-20 08:14:28 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2017-01-20 08:40:26 +0300 |
commit | 2e3fda2d95b4f0cb04b074c798ed266a41bf2a9d (patch) | |
tree | 74bb8127c0921f661c84ed8419fa3d06a4dd8c94 /source/blender/editors/space_action | |
parent | 831cfcfb3dc30ce3a3c8e7251a099ee09c02f34f (diff) |
DopeSheet: Show group colours behind keyframes too
Following @AlonDan's feature request and @hjalti's screenshot yesterday,
I've decided to implement support for this to make it easier to scan which
keyframes correspond with which set of controls, especially when faced with
a large wall of keyframes.
In retrospect, I should've done this a long time ago!
Diffstat (limited to 'source/blender/editors/space_action')
-rw-r--r-- | source/blender/editors/space_action/action_draw.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 9fc96e06299..7c9228e1fae 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -170,6 +170,8 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) unsigned char col1a[3], col2a[3]; unsigned char col1b[3], col2b[3]; + const bool show_group_colors = !(saction->flag & SACTION_NODRAWGCOLORS); + /* get theme colors */ UI_GetThemeColor3ubv(TH_BACK, col2); @@ -247,8 +249,36 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) } case ANIMTYPE_GROUP: { - if (sel) glColor4ub(col1a[0], col1a[1], col1a[2], 0x22); - else glColor4ub(col2a[0], col2a[1], col2a[2], 0x22); + bActionGroup *agrp = ale->data; + if (show_group_colors && agrp->customCol) { + if (sel) { + unsigned char *cp = agrp->cs.select; + glColor4ub(cp[0], cp[1], cp[2], 0x45); + } + else { + unsigned char *cp = agrp->cs.solid; + glColor4ub(cp[0], cp[1], cp[2], 0x1D); + } + } + else { + if (sel) glColor4ub(col1a[0], col1a[1], col1a[2], 0x22); + else glColor4ub(col2a[0], col2a[1], col2a[2], 0x22); + } + break; + } + case ANIMTYPE_FCURVE: + { + FCurve *fcu = ale->data; + if (show_group_colors && fcu->grp && fcu->grp->customCol) { + unsigned char *cp = fcu->grp->cs.active; + + if (sel) glColor4ub(cp[0], cp[1], cp[2], 0x65); + else glColor4ub(cp[0], cp[1], cp[2], 0x0B); + } + else { + if (sel) glColor4ub(col1[0], col1[1], col1[2], 0x22); + else glColor4ub(col2[0], col2[1], col2[2], 0x22); + } break; } default: |