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
This commit is contained in:
Brecht Van Lommel
2025-04-24 21:54:14 +02:00
committed by Philipp Oeser
parent 74a78f5e21
commit 67afa353f0
@@ -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;