diff options
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index aa4922372c8..478f48700ea 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1676,6 +1676,7 @@ void ED_view3d_draw_offscreen(Depsgraph *depsgraph, bool draw_background, const char *viewname, const bool do_color_management, + const bool restore_rv3d_mats, GPUOffScreen *ofs, GPUViewport *viewport) { @@ -1764,7 +1765,11 @@ void ED_view3d_draw_offscreen(Depsgraph *depsgraph, region->winy = orig.region_winy; region->winrct = orig.region_winrct; - ED_view3d_mats_rv3d_restore(region->regiondata, orig.rv3d_mats); + /* Optionally do _not_ restore rv3d matrices (e.g. they are used/stored in the ImBuff for + * reprojection, see texture_paint_image_from_view_exec(). */ + if (restore_rv3d_mats) { + ED_view3d_mats_rv3d_restore(region->regiondata, orig.rv3d_mats); + } MEM_freeN(orig.rv3d_mats); UI_Theme_Restore(&orig.theme_state); @@ -1856,6 +1861,7 @@ void ED_view3d_draw_offscreen_simple(Depsgraph *depsgraph, draw_background, viewname, do_color_management, + true, ofs, viewport); } @@ -1876,6 +1882,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Depsgraph *depsgraph, eImBufFlags imbuf_flag, int alpha_mode, const char *viewname, + const bool restore_rv3d_mats, /* output vars */ GPUOffScreen *ofs, char err_out[256]) @@ -1983,6 +1990,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Depsgraph *depsgraph, draw_sky, viewname, do_color_management, + restore_rv3d_mats, ofs, NULL); @@ -2108,6 +2116,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Depsgraph *depsgraph, imbuf_flag, alpha_mode, viewname, + true, ofs, err_out); } |