[Bf-blender-cvs] [cd90711f070] greasepencil-refactor: GPencil: Fix onion skin in render

Antonio Vazquez noreply at git.blender.org
Thu Jan 23 11:07:09 CET 2020


Commit: cd90711f07077e5701dd4a33687f80124bdf3046
Author: Antonio Vazquez
Date:   Thu Jan 23 11:07:02 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rBcd90711f07077e5701dd4a33687f80124bdf3046

GPencil: Fix onion skin in render

This commit fix two problems:

1) The onion skin was visible in render if the layer had the onion skin to ON, but the general onion swith was off. This made different viewport and render.

2) The option to render onion skin was not supported. By default, the onion skin is hidden in render, but there is an option to enable in render output.

===================================================================

M	source/blender/draw/engines/gpencil/gpencil_engine.c

===================================================================

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 5e6982ce6b6..0a00ede4e13 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -640,8 +640,12 @@ void GPENCIL_cache_populate(void *ved, Object *ob)
     iter.tex_fill = txl->dummy_texture;
     iter.tex_stroke = txl->dummy_texture;
 
+    /* Specil case for rendering onion skin. */
+    bGPdata *gpd = (bGPdata *)ob->data;
+    bool do_onion = (!pd->is_render) ? pd->do_onion : (gpd->onion_flag & GP_ONION_GHOST_ALWAYS);
+
     BKE_gpencil_visible_stroke_iter(
-        ob, gp_layer_cache_populate, gp_stroke_cache_populate, &iter, pd->do_onion, pd->cfra);
+        ob, gp_layer_cache_populate, gp_stroke_cache_populate, &iter, do_onion, pd->cfra);
 
     gp_drawcall_flush(&iter);



More information about the Bf-blender-cvs mailing list