diff options
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/blender_curves.cpp | 22 | ||||
-rw-r--r-- | intern/cycles/blender/blender_mesh.cpp | 12 | ||||
-rw-r--r-- | intern/cycles/blender/blender_shader.cpp | 18 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.h | 3 | ||||
-rw-r--r-- | intern/cycles/blender/blender_texture.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/blender/blender_texture.h | 1 | ||||
-rw-r--r-- | intern/cycles/blender/blender_util.h | 6 |
7 files changed, 12 insertions, 52 deletions
diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp index ba936a3f369..f2bb1b0158c 100644 --- a/intern/cycles/blender/blender_curves.cpp +++ b/intern/cycles/blender/blender_curves.cpp @@ -326,18 +326,6 @@ static bool ObtainCacheParticleVcol(Mesh *mesh, return true; } -static void set_resolution(BL::Object& b_ob, BL::Scene& scene, BL::ViewLayer& view_layer, bool render) -{ - BL::Object::modifiers_iterator b_mod; - for(b_ob.modifiers.begin(b_mod); b_mod != b_ob.modifiers.end(); ++b_mod) { - if((b_mod->type() == b_mod->type_PARTICLE_SYSTEM) && ((b_mod->show_viewport()) || (b_mod->show_render()))) { - BL::ParticleSystemModifier psmd((const PointerRNA)b_mod->ptr); - BL::ParticleSystem b_psys((const PointerRNA)psmd.particle_system().ptr); - b_psys.set_resolution(scene, view_layer, b_ob, (render)? 2: 1); - } - } -} - static void ExportCurveTrianglePlanes(Mesh *mesh, ParticleCurveData *CData, float3 RotCam, bool is_ortho) { @@ -884,8 +872,7 @@ void BlenderSync::sync_curve_settings() curve_system_manager->tag_update(scene); } -void BlenderSync::sync_curves(BL::Depsgraph& b_depsgraph, - Mesh *mesh, +void BlenderSync::sync_curves(Mesh *mesh, BL::Mesh& b_mesh, BL::Object& b_ob, bool motion, @@ -920,10 +907,6 @@ void BlenderSync::sync_curves(BL::Depsgraph& b_depsgraph, ParticleCurveData CData; - BL::ViewLayer b_view_layer = b_depsgraph.view_layer(); - if(!preview) - set_resolution(b_ob, b_scene, b_view_layer, true); - ObtainCacheParticleData(mesh, &b_mesh, &b_ob, &CData, !preview); /* add hair geometry to mesh */ @@ -1066,9 +1049,6 @@ void BlenderSync::sync_curves(BL::Depsgraph& b_depsgraph, } } - if(!preview) - set_resolution(b_ob, b_scene, b_view_layer, false); - mesh->compute_bounds(); } diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index afcfe3d434e..1e1e0db6c62 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -1188,10 +1188,8 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph& b_depsgraph, BL::Mesh b_mesh = object_to_mesh(b_data, b_ob, - b_scene, - b_depsgraph.view_layer(), + b_depsgraph, true, - !preview, need_undeformed, mesh->subdivision_type); @@ -1207,7 +1205,7 @@ Mesh *BlenderSync::sync_mesh(BL::Depsgraph& b_depsgraph, } if(view_layer.use_hair && mesh->subdivision_type == Mesh::SUBDIVISION_NONE) - sync_curves(b_depsgraph, mesh, b_mesh, b_ob, false); + sync_curves(mesh, b_mesh, b_ob, false); if(can_free_caches) { b_ob.cache_release(); @@ -1278,10 +1276,8 @@ void BlenderSync::sync_mesh_motion(BL::Depsgraph& b_depsgraph, /* get derived mesh */ b_mesh = object_to_mesh(b_data, b_ob, - b_scene, - b_depsgraph.view_layer(), + b_depsgraph, true, - !preview, false, Mesh::SUBDIVISION_NONE); } @@ -1390,7 +1386,7 @@ void BlenderSync::sync_mesh_motion(BL::Depsgraph& b_depsgraph, /* hair motion */ if(numkeys) - sync_curves(b_depsgraph, mesh, b_mesh, b_ob, true, motion_step); + sync_curves(mesh, b_mesh, b_ob, true, motion_step); /* free derived mesh */ b_data.meshes.remove(b_mesh, false, true, false); 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; diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h index 80316757798..468e287038c 100644 --- a/intern/cycles/blender/blender_sync.h +++ b/intern/cycles/blender/blender_sync.h @@ -120,8 +120,7 @@ private: BL::Object& b_ob_instance, bool object_updated, bool hide_tris); - void sync_curves(BL::Depsgraph& b_depsgraph, - Mesh *mesh, + void sync_curves(Mesh *mesh, BL::Mesh& b_mesh, BL::Object& b_ob, bool motion, diff --git a/intern/cycles/blender/blender_texture.cpp b/intern/cycles/blender/blender_texture.cpp index 637f3632a49..a0371a7eed8 100644 --- a/intern/cycles/blender/blender_texture.cpp +++ b/intern/cycles/blender/blender_texture.cpp @@ -36,7 +36,6 @@ void density_texture_space_invert(float3& loc, void point_density_texture_space(BL::Depsgraph& b_depsgraph, BL::ShaderNodeTexPointDensity& b_point_density_node, - int settings, float3& loc, float3& size) { @@ -48,7 +47,6 @@ void point_density_texture_space(BL::Depsgraph& b_depsgraph, } float3 min, max; b_point_density_node.calc_point_density_minmax(b_depsgraph, - settings, &min[0], &max[0]); loc = (min + max) * 0.5f; diff --git a/intern/cycles/blender/blender_texture.h b/intern/cycles/blender/blender_texture.h index 9c921d1e9f8..b4e166c5cdd 100644 --- a/intern/cycles/blender/blender_texture.h +++ b/intern/cycles/blender/blender_texture.h @@ -24,7 +24,6 @@ CCL_NAMESPACE_BEGIN void point_density_texture_space(BL::Depsgraph& b_depsgraph, BL::ShaderNodeTexPointDensity& b_point_density_node, - const int settings, float3& loc, float3& size); diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index 5b67ff85a9b..3eb09cbe3c0 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -45,10 +45,8 @@ void python_thread_state_restore(void **python_thread_state); static inline BL::Mesh object_to_mesh(BL::BlendData& data, BL::Object& object, - BL::Scene& scene, - BL::ViewLayer view_layer, + BL::Depsgraph& depsgraph, bool apply_modifiers, - bool render, bool calc_undeformed, Mesh::SubdivisionType subdivision_type) { @@ -65,7 +63,7 @@ static inline BL::Mesh object_to_mesh(BL::BlendData& data, subsurf_mod.show_viewport(false); } - BL::Mesh me = data.meshes.new_from_object(scene, view_layer, object, apply_modifiers, (render)? 2: 1, false, calc_undeformed); + BL::Mesh me = data.meshes.new_from_object(depsgraph, object, apply_modifiers, false, calc_undeformed); if(subdivision_type != Mesh::SUBDIVISION_NONE) { BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length()-1]; |