From 714e48ec55b6d787e2caa844eb9b1c14a45fc6da Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Mon, 16 Dec 2019 18:54:36 +0100 Subject: GPencil: Fix unreported missing onion skin in renders When the option was enabled, the onion was not render as expected. --- source/blender/draw/engines/gpencil/gpencil_draw_utils.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index 7e75edfddf3..4c6ce896ebc 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -1948,9 +1948,12 @@ void gpencil_populate_datablock(GPENCIL_e_data *e_data, bGPdata *gpd = (bGPdata *)ob->data; - const bool main_onion = stl->storage->is_main_onion; + /* If render mode, instead to use view switches, test if the datablock has + * the onion activated for render. */ + const bool render_onion = (gpd && gpd->onion_flag & GP_ONION_GHOST_ALWAYS); + const bool main_onion = (stl->storage->is_render) ? render_onion : stl->storage->is_main_onion; + const bool overlay = (stl->storage->is_render) ? render_onion : stl->storage->is_main_overlay; const bool playing = stl->storage->is_playing; - const bool overlay = stl->storage->is_main_overlay; const bool do_onion = (bool)((gpd->flag & GP_DATA_STROKE_WEIGHTMODE) == 0) && overlay && main_onion && !playing && gpencil_onion_active(gpd); -- cgit v1.2.3