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:
authorAntonioya <blendergit@gmail.com>2019-04-05 17:20:31 +0300
committerAntonioya <blendergit@gmail.com>2019-04-07 10:37:35 +0300
commitc536b61961d73b87b420a2b904e448d06df822db (patch)
tree84bfcb7eb3930b214826e3653ea7313a2ba93e10 /source/blender/editors/space_action/action_draw.c
parentd2d84132ddf9965e9de85325660d951978044a23 (diff)
GPencil: Set layer channel custom color to all line in Dopesheet
See D4645 for more details
Diffstat (limited to 'source/blender/editors/space_action/action_draw.c')
-rw-r--r--source/blender/editors/space_action/action_draw.c15
1 files changed, 14 insertions, 1 deletions
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));