From 7b9fb3259157cea2df5e7b461d04f55cfa380031 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 8 Apr 2018 09:28:52 +0200 Subject: Python API: remove preview/render resolution settings from API functions. For correct results these must have been set already when the depsgraph was created and evaluated, so all dependencies have appropriate resolutions too. For particle we no longer backup and restore the viewport particles to avoid overwriting them during render, as copy-on-write solves this for us. Even without COW particles seem to work ok. This also removes the particle simplification options based on camera. This was never used much and only available in Blender Internal. Differential Revision: https://developer.blender.org/D3148 --- intern/cycles/blender/blender_shader.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'intern/cycles/blender/blender_shader.cpp') diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index d6e3f33fa9d..21137562152 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -236,7 +236,6 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData& b_data, BL::Depsgraph& b_depsgraph, BL::Scene& b_scene, - const bool background, ShaderGraph *graph, BL::ShaderNodeTree& b_ntree, BL::ShaderNode& b_node) @@ -843,12 +842,9 @@ static ShaderNode *add_node(Scene *scene, point_density->interpolation = get_image_interpolation(b_point_density_node); point_density->builtin_data = b_point_density_node.ptr.data; - /* 1 - render settings, 0 - vewport settings. */ - int settings = background ? 1 : 0; - /* TODO(sergey): Use more proper update flag. */ if(true) { - b_point_density_node.cache_point_density(b_depsgraph, settings); + b_point_density_node.cache_point_density(b_depsgraph); scene->image_manager->tag_reload_image( point_density->filename.string(), point_density->builtin_data, @@ -868,7 +864,6 @@ static ShaderNode *add_node(Scene *scene, float3 loc, size; point_density_texture_space(b_depsgraph, b_point_density_node, - settings, loc, size); point_density->tfm = @@ -1008,7 +1003,6 @@ static void add_nodes(Scene *scene, BL::BlendData& b_data, BL::Depsgraph& b_depsgraph, BL::Scene& b_scene, - const bool background, ShaderGraph *graph, BL::ShaderNodeTree& b_ntree, const ProxyMap &proxy_input_map, @@ -1095,7 +1089,6 @@ static void add_nodes(Scene *scene, b_data, b_depsgraph, b_scene, - background, graph, b_group_ntree, group_proxy_input_map, @@ -1143,7 +1136,6 @@ static void add_nodes(Scene *scene, b_data, b_depsgraph, b_scene, - background, graph, b_ntree, b_shader_node); @@ -1207,7 +1199,6 @@ static void add_nodes(Scene *scene, BL::BlendData& b_data, BL::Depsgraph& b_depsgraph, BL::Scene& b_scene, - const bool background, ShaderGraph *graph, BL::ShaderNodeTree& b_ntree) { @@ -1217,7 +1208,6 @@ static void add_nodes(Scene *scene, b_data, b_depsgraph, b_scene, - background, graph, b_ntree, empty_proxy_map, @@ -1255,7 +1245,7 @@ void BlenderSync::sync_materials(BL::Depsgraph& b_depsgraph, bool update_all) if(b_mat->use_nodes() && b_mat->node_tree()) { BL::ShaderNodeTree b_ntree(b_mat->node_tree()); - add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, !preview, graph, b_ntree); + add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree); } else { DiffuseBsdfNode *diffuse = new DiffuseBsdfNode(); @@ -1326,7 +1316,7 @@ void BlenderSync::sync_world(BL::Depsgraph& b_depsgraph, bool update_all) if(b_world && b_world.use_nodes() && b_world.node_tree()) { BL::ShaderNodeTree b_ntree(b_world.node_tree()); - add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, !preview, graph, b_ntree); + add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree); /* volume */ PointerRNA cworld = RNA_pointer_get(&b_world.ptr, "cycles"); @@ -1428,7 +1418,7 @@ void BlenderSync::sync_lamps(BL::Depsgraph& b_depsgraph, bool update_all) BL::ShaderNodeTree b_ntree(b_lamp->node_tree()); - add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, !preview, graph, b_ntree); + add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree); } else { float strength = 1.0f; -- cgit v1.2.3