Fix T86956: VSE shading mode ignores Grease Pencil Vertex colors.

Issue is that due to the strange definition of render in grease pencil
(meaning should be rendered similar to rendering). This included normal
viewport rendering in OB_RENDER and OpenGL render in OB_RENDER.

For other rendering modes the overlay vertex opacity would be used. This
patch sets this value to 1 when rendering via a scene strip override.

NOTE: that this isn't a good solution as I expect that users want to use
the opacity of the Grease pencil object. Perhaps the GPencil team has a
better solution for it.
This commit is contained in:
Jeroen Bakker 2021-05-25 15:10:46 +02:00
parent b4a81d8053
commit baa7a53974
Notes: blender-bot 2023-02-14 05:44:22 +01:00
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #89353, 2.93 - Cycles Volumetrics - GPU and CPU results look inverted (Distance vs Equiangular sampling)
Referenced by issue #86956, VSE shading mode ignores Grease Pencil Vertex colors
2 changed files with 6 additions and 1 deletions

View File

@ -297,7 +297,9 @@ typedef struct GPENCIL_PrivateData {
int v3d_color_type;
/* Current frame */
int cfra;
/* If we are rendering for final render (F12). */
/* If we are rendering for final render (F12).
* NOTE: set to false for viewport and opengl rendering (including VSE scene rendering), but set
* to true when rendering in `OB_RENDER` shading mode (viewport or opengl rendering) */
bool is_render;
/* If we are in viewport display (used for VFX). */
bool is_viewport;

View File

@ -2029,6 +2029,9 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Depsgraph *depsgraph,
}
v3d.flag2 = V3D_HIDE_OVERLAYS;
/* HACK: When rendering gpencil objects this opacity is used to mix vertex colors in when not in
* render mode. */
v3d.overlay.gpencil_vertex_paint_opacity = 1.0f;
if (draw_flags & V3D_OFSDRAW_SHOW_ANNOTATION) {
v3d.flag2 |= V3D_SHOW_ANNOTATION;