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
This commit is contained in:
Brecht Van Lommel 2021-11-29 15:25:39 +01:00
parent 03c9563582
commit 2206b6b9a0
Notes: blender-bot 2023-02-14 08:24:03 +01:00
Referenced by issue #93353, Reload Library Override file loses Constraints
Referenced by issue #92628, File explorer thumbnail renders as a black image when using cycles rendered preview 3.0
1 changed files with 9 additions and 0 deletions

View File

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