diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-07-20 04:29:08 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-07-20 04:32:26 +0300 |
commit | b219ae4498ef329015932cb4ba052b0e168cbd81 (patch) | |
tree | 9943123e741c7803c6d9e8f07bd436faf0496593 /source/blender/editors/space_view3d | |
parent | 615af4e23969529371fbc594d8cf61dc13612790 (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')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 6 |
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; } |