diff options
-rw-r--r-- | intern/cycles/blender/blender_shader.cpp | 11 | ||||
-rw-r--r-- | source/blender/editors/render/render_preview.c | 11 |
2 files changed, 20 insertions, 2 deletions
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index c3e68e1ae5a..1d2470f6e8a 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -886,7 +886,16 @@ void BlenderSync::sync_world(bool update_all) } PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); - background->transparent = get_boolean(cscene, "film_transparent"); + + /* when doing preview render check for BI's transparency settings, + * this is so because bledner's preview render routines are not able + * to tweak all cycles's settings depending on different circumstances + */ + if(b_engine.is_preview() == false) + background->transparent = get_boolean(cscene, "film_transparent"); + else + background->transparent = b_scene.render().alpha_mode() == BL::RenderSettings::alpha_mode_TRANSPARENT; + background->use = render_layer.use_background; if(background->modified(prevbackground)) diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 08349e2e0bb..a42f15a9037 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -382,6 +382,10 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre } else { sce->lay = 1 << MA_SPHERE_A; + + /* same as above, use current scene world to light sphere */ + if (BKE_scene_use_new_shading_nodes(scene)) + sce->world = scene->world; } } else { @@ -1026,6 +1030,7 @@ static void icon_preview_startjob_all_sizes(void *customdata, short *stop, short { IconPreview *ip = (IconPreview *)customdata; IconPreviewSize *cur_size = ip->sizes.first; + int use_new_shading = BKE_scene_use_new_shading_nodes(ip->scene); while (cur_size) { ShaderPreview *sp = MEM_callocN(sizeof(ShaderPreview), "Icon ShaderPreview"); @@ -1038,7 +1043,11 @@ static void icon_preview_startjob_all_sizes(void *customdata, short *stop, short sp->pr_method = PR_ICON_RENDER; sp->pr_rect = cur_size->rect; sp->id = ip->id; - sp->pr_main = G_pr_main; + + if (use_new_shading) + sp->pr_main = G_pr_main_cycles; + else + sp->pr_main = G_pr_main; common_preview_startjob(sp, stop, do_update, progress); shader_preview_free(sp); |