From 2206b6b9a04777b7325c8f30a49db23bc9a61317 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 29 Nov 2021 15:25:39 +0100 Subject: 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 --- source/blender/editors/space_view3d/view3d_draw.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/editors') 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; -- cgit v1.2.3