[Bf-blender-cvs] [c536b61961d] master: GPencil: Set layer channel custom color to all line in Dopesheet
Antonioya
noreply at git.blender.org
Sun Apr 7 09:37:47 CEST 2019
Commit: c536b61961d73b87b420a2b904e448d06df822db
Author: Antonioya
Date: Fri Apr 5 16:20:31 2019 +0200
Branches: master
https://developer.blender.org/rBc536b61961d73b87b420a2b904e448d06df822db
GPencil: Set layer channel custom color to all line in Dopesheet
See D4645 for more details
===================================================================
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 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 <float.h>
#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));
More information about the Bf-blender-cvs
mailing list