[Bf-blender-cvs] [2e3fda2d95] master: DopeSheet: Show group colours behind keyframes too

Joshua Leung noreply at git.blender.org
Fri Jan 20 06:44:01 CET 2017


Commit: 2e3fda2d95b4f0cb04b074c798ed266a41bf2a9d
Author: Joshua Leung
Date:   Fri Jan 20 18:14:28 2017 +1300
Branches: master
https://developer.blender.org/rB2e3fda2d95b4f0cb04b074c798ed266a41bf2a9d

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!

===================================================================

M	source/blender/editors/space_action/action_draw.c

===================================================================

diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c
index 9fc96e0629..7c9228e1fa 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:




More information about the Bf-blender-cvs mailing list