Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2021-02-10 14:46:43 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-02-10 15:25:31 +0300
commit97cc130f472fa2e5e12ae07312abae2de7d409aa (patch)
treedb0380027e6daff7f300ce36facc88e3793c6ac3 /source/blender/editors/space_view3d/view3d_draw.c
parentd76890bfb0bba78d7ad617c5ad8fb284cd9814d4 (diff)
Fix T85395: Texture paint external edit wrong projection on reapply
Caused by rB5b34d11b55e0. Above commit restored the view matrices in ED_view3d_draw_offscreen _before_ they can be stored in the ImBuff (see ED_view3d_draw_offscreen / texture_paint_image_from_view_exec). Now make restoring the view matrices optional and dont do this in case of reprojection, so the used matrices can still be saved in the ImBuff later. Reviewed By: campbellbarton Maniphest Tasks: T85395 Differential Revision: https://developer.blender.org/D10331
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c11
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 8ae0e3b94fe..9982d44b6be 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1667,6 +1667,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)
{
@@ -1755,7 +1756,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);
@@ -1847,6 +1852,7 @@ void ED_view3d_draw_offscreen_simple(Depsgraph *depsgraph,
draw_background,
viewname,
do_color_management,
+ true,
ofs,
viewport);
}
@@ -1867,6 +1873,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])
@@ -1974,6 +1981,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Depsgraph *depsgraph,
draw_sky,
viewname,
do_color_management,
+ restore_rv3d_mats,
ofs,
NULL);
@@ -2099,6 +2107,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Depsgraph *depsgraph,
imbuf_flag,
alpha_mode,
viewname,
+ true,
ofs,
err_out);
}