diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-05-28 20:32:25 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-06-13 18:47:11 +0400 |
commit | 477f35559cf20ea6cc81fa3d3a0ec1b886dbf5e4 (patch) | |
tree | 5d7b88fc9cac1bc5d2a11bd8146117ff50da863d /source/blender/editors/render | |
parent | b72eca435ebdbd10359b7c0fc67cb9eddc1b2dcf (diff) |
Code cleanup: reorder BKE_scene_use_new_shading_nodes checks last
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r-- | source/blender/editors/render/render_preview.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 46777685442..e3b4051b8e0 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -299,10 +299,10 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre sce->r.cfra = scene->r.cfra; - if (id_type == ID_TE && ELEM(sp->pr_method, PR_ICON_RENDER, PR_NODE_RENDER)) { - /* Force blender internal for texture icons and nodes render, + if (id_type == ID_TE && sp->pr_method == PR_ICON_RENDER) { + /* force blender internal for texture icons render, * seems commonly used render engines does not support - * such kind of rendering. + * such kind of rendering */ BLI_strncpy(sce->r.engine, "BLENDER_RENDER", sizeof(sce->r.engine)); } @@ -1137,6 +1137,11 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M wmJob *wm_job; ShaderPreview *sp; Scene *scene = CTX_data_scene(C); + const bool use_new_shading = BKE_scene_use_new_shading_nodes(scene); + + /* node previews not supported for cycles */ + if ((method == PR_NODE_RENDER) && use_new_shading) + 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); @@ -1154,7 +1159,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 (BKE_scene_use_new_shading_nodes(scene) && method != PR_NODE_RENDER) + if (use_new_shading) sp->pr_main = G_pr_main_cycles; else sp->pr_main = G_pr_main; |