diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-11-29 17:25:39 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-11-29 18:27:55 +0300 |
commit | 2206b6b9a04777b7325c8f30a49db23bc9a61317 (patch) | |
tree | 4196a8085003a65b27c4600bc9a9f55abbabcab1 | |
parent | 03c956358249851bdd8860b87b88985bd29044cf (diff) |
Fix T92628: .blend thumbnail renders black with Cycles 3D viewport render
Don't use Cycles for rendering thumbnails, fall back to Solid shading.
Differential Revision: https://developer.blender.org/D13406
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index fceb6553cab..4ab92a4470f 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2048,6 +2048,15 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Depsgraph *depsgraph, } memcpy(&v3d.shading, source_shading_settings, sizeof(View3DShading)); + if (drawtype == OB_RENDER) { + /* Don't use external engines for preview. Fall back to solid instead of Eevee as rendering + * with Eevee is potentially slow due to compiling shaders and loading textures, and the + * depsgraph may not have been updated to have all the right geometry attributes. */ + if (!(BKE_scene_uses_blender_eevee(scene) || BKE_scene_uses_blender_workbench(scene))) { + drawtype = OB_SOLID; + } + } + if (drawtype == OB_MATERIAL) { v3d.shading.flag = V3D_SHADING_SCENE_WORLD | V3D_SHADING_SCENE_LIGHTS; v3d.shading.render_pass = SCE_PASS_COMBINED; |