forked from bartvdbraak/blender
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:
parent
0529766f32
commit
da64e8ae05
@ -1138,6 +1138,12 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
|
|||||||
ShaderPreview *sp;
|
ShaderPreview *sp;
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
short id_type = GS(id->name);
|
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 = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner, "Shader Preview",
|
||||||
WM_JOB_EXCL_RENDER, WM_JOB_TYPE_RENDER_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
|
/* hardcoded preview .blend for cycles/internal, this should be solved
|
||||||
* once with custom preview .blend path for external engines */
|
* once with custom preview .blend path for external engines */
|
||||||
if ((method != PR_NODE_RENDER) &&
|
if ((method != PR_NODE_RENDER) && id_type != ID_TE && use_new_shading) {
|
||||||
id_type != ID_TE &&
|
|
||||||
BKE_scene_use_new_shading_nodes(scene))
|
|
||||||
{
|
|
||||||
sp->pr_main = G_pr_main_cycles;
|
sp->pr_main = G_pr_main_cycles;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user