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:
authorAntonio Vazquez <blendergit@gmail.com>2019-09-10 18:37:27 +0300
committerAntonio Vazquez <blendergit@gmail.com>2019-09-10 18:41:23 +0300
commit0174185e2fb75b2b7825e8d6e1bbe2b0babfa90d (patch)
tree80b573bea8f862bb7d035c9bd5ee0bab1120ee68 /source/blender/draw
parent8f55794c0e803ec5454febe2e45651c721f62c8f (diff)
GPencil: New Simplify Tint option
This is useful to disable all layers tint in one step and it will be used for future operators.
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_draw_utils.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index d49cc728551..882f2285296 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -1922,6 +1922,7 @@ void gpencil_populate_multiedit(GPENCIL_e_data *e_data,
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
const DRWContextState *draw_ctx = DRW_context_state_get();
+ Scene *scene = draw_ctx->scene;
int cfra_eval = (int)DEG_get_ctime(draw_ctx->depsgraph);
GpencilBatchCache *cache = gpencil_batch_cache_get(ob, cfra_eval);
@@ -1937,39 +1938,23 @@ void gpencil_populate_multiedit(GPENCIL_e_data *e_data,
if (gpl->flag & GP_LAYER_HIDE) {
continue;
}
+ const float alpha = GPENCIL_SIMPLIFY_TINT(scene, playing) ? 0.0f : gpl->tintcolor[3];
+ const float tintcolor[4] = {gpl->tintcolor[0], gpl->tintcolor[1], gpl->tintcolor[2], alpha};
/* list of frames to draw */
if (!playing) {
for (gpf = gpl->frames.first; gpf; gpf = gpf->next) {
if ((gpf == gpl->actframe) || (gpf->flag & GP_FRAME_SELECT)) {
- gpencil_draw_strokes(cache,
- e_data,
- vedata,
- ob,
- gpd,
- gpl,
- gpf,
- gpl->opacity,
- gpl->tintcolor,
- false,
- cache_ob);
+ gpencil_draw_strokes(
+ cache, e_data, vedata, ob, gpd, gpl, gpf, gpl->opacity, tintcolor, false, cache_ob);
}
}
}
else {
gpf = BKE_gpencil_layer_getframe(gpl, cfra_eval, GP_GETFRAME_USE_PREV);
if (gpf) {
- gpencil_draw_strokes(cache,
- e_data,
- vedata,
- ob,
- gpd,
- gpl,
- gpf,
- gpl->opacity,
- gpl->tintcolor,
- false,
- cache_ob);
+ gpencil_draw_strokes(
+ cache, e_data, vedata, ob, gpd, gpl, gpf, gpl->opacity, tintcolor, false, cache_ob);
}
}
}
@@ -2091,8 +2076,10 @@ void gpencil_populate_datablock(GPENCIL_e_data *e_data,
}
}
/* draw normal strokes */
+ const float alpha = GPENCIL_SIMPLIFY_TINT(scene, playing) ? 0.0f : gpl->tintcolor[3];
+ const float tintcolor[4] = {gpl->tintcolor[0], gpl->tintcolor[1], gpl->tintcolor[2], alpha};
gpencil_draw_strokes(
- cache, e_data, vedata, ob, gpd, gpl, gpf_eval, opacity, gpl->tintcolor, false, cache_ob);
+ cache, e_data, vedata, ob, gpd, gpl, gpf_eval, opacity, tintcolor, false, cache_ob);
}
/* create batchs and shading groups */