Fix T40800: Crash when editing material nodes

it was caused by ee5f432. Not sure why exactly blender runs into
threading conflicts here since material preview works.

Let's keep it simple for now and disable material nodes preview,
because it's not supported by the interface anyway.

This is to be included to the final release.
This commit is contained in:
Sergey Sharybin 2014-06-25 15:36:45 +06:00
parent 0529766f32
commit da64e8ae05
Notes: blender-bot 2023-02-14 10:31:52 +01:00
Referenced by issue #40800, If Viewport shading is 'Rendered', B3D crashes after browsing to file for texture node and connecting to any shader node.
Referenced by issue #40763, Cycles Viewport render crashes often when reconnecting nodes.
Referenced by issue #40525, Blender Crash/Freeze On Animation Plays
1 changed files with 7 additions and 4 deletions

View File

@ -1138,6 +1138,12 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
ShaderPreview *sp;
Scene *scene = CTX_data_scene(C);
short id_type = GS(id->name);
bool use_new_shading = BKE_scene_use_new_shading_nodes(scene);
/* Only texture node preview is supported with Cycles. */
if (use_new_shading && method == PR_NODE_RENDER && id_type != ID_TE) {
return;
}
wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner, "Shader Preview",
WM_JOB_EXCL_RENDER, WM_JOB_TYPE_RENDER_PREVIEW);
@ -1155,10 +1161,7 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
/* hardcoded preview .blend for cycles/internal, this should be solved
* once with custom preview .blend path for external engines */
if ((method != PR_NODE_RENDER) &&
id_type != ID_TE &&
BKE_scene_use_new_shading_nodes(scene))
{
if ((method != PR_NODE_RENDER) && id_type != ID_TE && use_new_shading) {
sp->pr_main = G_pr_main_cycles;
}
else {