From c536b61961d73b87b420a2b904e448d06df822db Mon Sep 17 00:00:00 2001 From: Antonioya Date: Fri, 5 Apr 2019 16:20:31 +0200 Subject: GPencil: Set layer channel custom color to all line in Dopesheet See D4645 for more details --- source/blender/editors/space_action/action_draw.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_action') diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 997b18f2013..8cfb77e58d7 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -30,12 +30,14 @@ #include #include "BLI_blenlib.h" +#include "BLI_math.h" #include "BLI_utildefines.h" /* Types --------------------------------------------------------------- */ #include "DNA_anim_types.h" #include "DNA_cachefile_types.h" +#include "DNA_gpencil_types.h" #include "DNA_object_types.h" #include "DNA_screen_types.h" #include "DNA_scene_types.h" @@ -289,8 +291,19 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) immRectf(pos, act_start, (float)y - ACHANNEL_HEIGHT_HALF(ac), act_end, (float)y + ACHANNEL_HEIGHT_HALF(ac)); } else if (ac->datatype == ANIMCONT_GPENCIL) { + unsigned char *color; + if ((show_group_colors) && (ale->type == ANIMTYPE_GPLAYER)) { + bGPDlayer *gpl = (bGPDlayer *)ale->data; + unsigned char gpl_col[4]; + rgb_float_to_uchar(gpl_col, gpl->color); + gpl_col[3] = col1[3]; + + color = sel ? col1 : gpl_col; + } + else { + color = sel ? col1 : col2; + } /* frames less than one get less saturated background */ - unsigned char *color = sel ? col1 : col2; immUniformColor4ubv(color); immRectf(pos, 0.0f, (float)y - ACHANNEL_HEIGHT_HALF(ac), v2d->cur.xmin, (float)y + ACHANNEL_HEIGHT_HALF(ac)); -- cgit v1.2.3