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:
authorCampbell Barton <ideasman42@gmail.com>2020-07-20 04:29:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-07-20 04:32:26 +0300
commitb219ae4498ef329015932cb4ba052b0e168cbd81 (patch)
tree9943123e741c7803c6d9e8f07bd436faf0496593 /source/blender/editors/space_view3d/view3d_draw.c
parent615af4e23969529371fbc594d8cf61dc13612790 (diff)
Fix T79077: Off-screen rendering ignores shading argument
Thumbnails used the 3D view shading mode when a camera wasn't used.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index b4098f17212..cc5f7deb418 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1699,6 +1699,11 @@ void ED_view3d_draw_offscreen(Depsgraph *depsgraph,
/* set flags */
G.f |= G_FLAG_RENDER_VIEWPORT;
+ /* There are too many functions inside the draw manager that check the shading type,
+ * so use a temporary override instead. */
+ const eDrawType drawtype_orig = v3d->shading.type;
+ v3d->shading.type = drawtype;
+
{
/* free images which can have changed on frame-change
* warning! can be slow so only free animated images - campbell */
@@ -1739,6 +1744,7 @@ void ED_view3d_draw_offscreen(Depsgraph *depsgraph,
UI_Theme_Restore(&theme_state);
+ v3d->shading.type = drawtype_orig;
G.f &= ~G_FLAG_RENDER_VIEWPORT;
}