diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2019-05-07 16:01:12 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2019-05-09 16:13:11 +0300 |
commit | 6ef48b13186c2de003c8f9d86630e66c7e5406f3 (patch) | |
tree | 974c294bd86941e49b3816a34c05c7f8d9aec65c /source/blender/draw | |
parent | 0764cfe3deea2d39376a660ff06e8dc17f6401ba (diff) |
DrawManager/GreasePencil: Select Correct ViewLayer
The DrawManager assumed that the first render layer was the render layer
where GP needed to render on. In viewport this is always the case as we
only have a single view layer. When rendering this can be multiple when
multiple layers are rendered and composited in the compositor.
In stead of the assumption that the first render layer is the render
layer we need to draw on, we search for the render layer with the same
name as the viewlayer.
Reviewed By: fclem, brecht, antoniov
Maniphest Tasks: T63099
Differential Revision: https://developer.blender.org/D4818
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 3bf3eaae4a2..0b8740ea982 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1883,9 +1883,9 @@ static void DRW_render_gpencil_to_image(RenderEngine *engine, void DRW_render_gpencil(struct RenderEngine *engine, struct Depsgraph *depsgraph) { - /* This function is only valid for Cycles - * Eevee done all work in the Eevee render directly. - * Maybe it can be done equal for both engines? + /* This function is only valid for Cycles & Workbench + * Eevee does all work in the Eevee render directly. + * Maybe it can be done equal for all engines? */ if (STREQ(engine->type->name, "Eevee")) { return; @@ -1952,7 +1952,7 @@ void DRW_render_gpencil(struct RenderEngine *engine, struct Depsgraph *depsgraph } RenderResult *render_result = RE_engine_get_result(engine); - RenderLayer *render_layer = render_result->layers.first; + RenderLayer *render_layer = RE_GetRenderLayer(render_result, view_layer->name); DRW_render_gpencil_to_image(engine, render_layer, &render_rect); |