diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-02-03 23:21:11 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-02-07 14:18:15 +0300 |
commit | 46c9872afaa8053f8b2894c038402b1beb3ac66c (patch) | |
tree | 5369b64bfcd14b0ed76c657edd075ae18ef0ba9e /intern/cycles/blender | |
parent | 47402dcb9160793fcfd87ea3c6e6685ea6954b3f (diff) |
Cleanup: remove unnecessary operations in Cycles curves export
Clearing and computing bounds is already done elsewhere.
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/blender_curves.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/intern/cycles/blender/blender_curves.cpp b/intern/cycles/blender/blender_curves.cpp index 64efaab70e0..e42151d8f48 100644 --- a/intern/cycles/blender/blender_curves.cpp +++ b/intern/cycles/blender/blender_curves.cpp @@ -989,24 +989,11 @@ bool BlenderSync::object_has_particle_hair(BL::Object b_ob) void BlenderSync::sync_particle_hair( Mesh *mesh, BL::Mesh &b_mesh, BL::Object &b_ob, bool motion, int motion_step) { - if (!motion) { - /* Clear stored curve data */ - mesh->curve_keys.clear(); - mesh->curve_radius.clear(); - mesh->curve_first_key.clear(); - mesh->curve_shader.clear(); - mesh->curve_attributes.clear(); - } - - /* obtain general settings */ - const bool use_curves = scene->curve_system_manager->use_curves; - - if (!(use_curves && b_ob.mode() != b_ob.mode_PARTICLE_EDIT && b_ob.mode() != b_ob.mode_EDIT)) { - if (!motion) - mesh->compute_bounds(); + if (b_ob.mode() == b_ob.mode_PARTICLE_EDIT || b_ob.mode() == b_ob.mode_EDIT) { return; } + /* obtain general settings */ const int primitive = scene->curve_system_manager->primitive; const int triangle_method = scene->curve_system_manager->triangle_method; const int resolution = scene->curve_system_manager->resolution; @@ -1159,7 +1146,6 @@ void BlenderSync::sync_particle_hair( } } - mesh->compute_bounds(); mesh->geometry_flags |= Mesh::GEOMETRY_CURVES; } @@ -1172,7 +1158,7 @@ void BlenderSync::sync_hair(BL::Depsgraph b_depsgraph, BL::Object b_ob, Mesh *me oldcurve_keys.steal_data(mesh->curve_keys); oldcurve_radius.steal_data(mesh->curve_radius); - if (view_layer.use_hair) { + if (view_layer.use_hair && scene->curve_system_manager->use_curves) { /* Particle hair. */ bool need_undeformed = mesh->need_attribute(scene, ATTR_STD_GENERATED); BL::Mesh b_mesh = object_to_mesh( |