Revert part of rB477f35 (error resolving conflict)
authorCampbell Barton <ideasman42@gmail.com>
Fri, 13 Jun 2014 15:06:49 +0000 (01:06 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 13 Jun 2014 15:06:49 +0000 (01:06 +1000)
source/blender/editors/render/render_preview.c
source/blender/editors/space_buttons/buttons_texture.c

index e3b4051b8e0b97a1b0b942a6329bfae6d6160418..5ae7570df78f9f12bb560283146d75e2d64fbfe9 100644 (file)
@@ -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 && sp->pr_method == PR_ICON_RENDER) {
-                       /* force blender internal for texture icons render,
+               if (id_type == ID_TE && ELEM(sp->pr_method, PR_ICON_RENDER, PR_NODE_RENDER)) {
+                       /* Force blender internal for texture icons and nodes 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,11 +1137,6 @@ 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);
@@ -1159,7 +1154,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 (use_new_shading)
+       if ((method != PR_NODE_RENDER) && BKE_scene_use_new_shading_nodes(scene))
                sp->pr_main = G_pr_main_cycles;
        else
                sp->pr_main = G_pr_main;
index c558d811693fc9a86d36c18b514fba9751d95ad9..0aa3e47df4b44f47fe689bbdb4bf44c3daab3974 100644 (file)
@@ -442,7 +442,7 @@ void buttons_texture_context_compute(const bContext *C, SpaceButs *sbuts)
 
        set_texture_context(C, sbuts);
 
-       if (!(BKE_scene_use_new_shading_nodes(scene) || (sbuts->texture_context == SB_TEXC_OTHER))) {
+       if (!((sbuts->texture_context == SB_TEXC_OTHER) || BKE_scene_use_new_shading_nodes(scene))) {
                if (ct) {
                        BLI_freelistN(&ct->users);
                        MEM_freeN(ct);