From 67afa353f0b5a938e364e17490847db0183a77a9 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 24 Apr 2025 21:54:14 +0200 Subject: [PATCH] Fix #137821: Crash with grease pencil render, compositor and render region When using the compositor, the parent scene overrides the render resolution and region of the child scene. Unlike workbench and EEVEE, the grease pencil engine was reading this information from the child scene. Pull Request: https://projects.blender.org/blender/blender/pulls/137923 --- source/blender/draw/engines/gpencil/gpencil_render.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/draw/engines/gpencil/gpencil_render.cc b/source/blender/draw/engines/gpencil/gpencil_render.cc index 1d59557c47d..5bff94c14d9 100644 --- a/source/blender/draw/engines/gpencil/gpencil_render.cc +++ b/source/blender/draw/engines/gpencil/gpencil_render.cc @@ -30,7 +30,6 @@ void GPENCIL_render_init(GPENCIL_Data *vedata, GPENCIL_FramebufferList *fbl = vedata->fbl; GPENCIL_TextureList *txl = vedata->txl; - Scene *scene = DEG_get_evaluated_scene(depsgraph); const float *viewport_size = DRW_viewport_size_get(); const int size[2] = {int(viewport_size[0]), int(viewport_size[1])}; @@ -84,7 +83,8 @@ void GPENCIL_render_init(GPENCIL_Data *vedata, } } - const bool do_region = (scene->r.mode & R_BORDER) != 0; + const bool do_region = !(rect->xmin == 0 && rect->ymin == 0 && rect->xmax == size[0] && + rect->ymax == size[1]); const bool do_clear_z = !pix_z || do_region; const bool do_clear_col = !pix_col || do_region;