[Bf-blender-cvs] [b219ae4498e] master: Fix T79077: Off-screen rendering ignores shading argument

Campbell Barton noreply at git.blender.org
Mon Jul 20 03:33:42 CEST 2020


Commit: b219ae4498ef329015932cb4ba052b0e168cbd81
Author: Campbell Barton
Date:   Mon Jul 20 11:29:08 2020 +1000
Branches: master
https://developer.blender.org/rBb219ae4498ef329015932cb4ba052b0e168cbd81

Fix T79077: Off-screen rendering ignores shading argument

Thumbnails used the 3D view shading mode when a camera wasn't used.

===================================================================

M	source/blender/editors/space_view3d/view3d_draw.c

===================================================================

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;
 }



More information about the Bf-blender-cvs mailing list