diff --git a/source/blender/editors/sculpt_paint/sculpt_expand.cc b/source/blender/editors/sculpt_paint/sculpt_expand.cc index e2498aa66cd..e82f9653f2c 100644 --- a/source/blender/editors/sculpt_paint/sculpt_expand.cc +++ b/source/blender/editors/sculpt_paint/sculpt_expand.cc @@ -1194,7 +1194,6 @@ static void write_mask_data(SculptSession *ss, const Span mask) BKE_pbvh_vertex_iter_end; BKE_pbvh_node_mark_redraw(node); } - attribute.finish(); break; } case PBVH_BMESH: { diff --git a/source/blender/editors/sculpt_paint/sculpt_geodesic.cc b/source/blender/editors/sculpt_paint/sculpt_geodesic.cc index a047a28c780..708b4a8956b 100644 --- a/source/blender/editors/sculpt_paint/sculpt_geodesic.cc +++ b/source/blender/editors/sculpt_paint/sculpt_geodesic.cc @@ -6,9 +6,6 @@ * \ingroup edsculpt */ -#include "BLI_math_base.hh" -#include - #include #include @@ -98,10 +95,7 @@ static void lock_free_emplace(const int edge_other, queue_next[idx] = edge_other; } -static float *geodesic_mesh_create(Object *ob, - GSet *initial_verts, - const float limit_radius, - int &size) +static float *geodesic_mesh_create(Object *ob, GSet *initial_verts, const float limit_radius) { constexpr const int non_checked = -1; SculptSession *ss = ob->sculpt; @@ -118,7 +112,6 @@ static float *geodesic_mesh_create(Object *ob, const bke::AttributeAccessor attributes = mesh->attributes(); const VArraySpan hide_poly = *attributes.lookup(".hide_poly", bke::AttrDomain::Face); - size = totvert; float *dists = static_cast(MEM_malloc_arrayN(totvert, sizeof(float), __func__)); if (ss->edge_to_face_map.is_empty()) { @@ -268,45 +261,6 @@ static float *geodesic_mesh_create(Object *ob, return dists; } -static float *geodesic_mesh_create_test(Object *ob, GSet *initial_verts, const float limit_radius) -{ - int size; - return geodesic_mesh_create(ob, initial_verts, limit_radius, size); - - constexpr const int tests_num = 100; - - float *reerence = geodesic_mesh_create(ob, initial_verts, limit_radius, size); - const IndexRange range(size); - for (const int i : IndexRange(tests_num)) { - std::cout << "[" << i << ", " << tests_num << "] ... "; - float *to_test = geodesic_mesh_create(ob, initial_verts, limit_radius, size); - - if (std::any_of(range.begin(), range.end(), [&](const int i) -> bool { - if (math::distance(reerence[i], to_test[i]) > 0.006f) { - std::cout << "\n >> " << reerence[i] << ", " << to_test[i] << ";\n"; - } - return math::distance(reerence[i], to_test[i]) > 0.006f; - })) - { - std::cout << "{RATA RACE} "; - - float *diff = static_cast(MEM_malloc_arrayN(size, sizeof(float), __func__)); - - for (const int i : range) { - diff[i] = math::distance(reerence[i], to_test[i]); - } - - MEM_freeN(reerence); - MEM_freeN(to_test); - return diff; - } - - MEM_freeN(to_test); - std::cout << "END\n"; - } - return reerence; -} - /* For sculpt mesh data that does not support a geodesic distances algorithm, fallback to the * distance to each vertex. In this case, only one of the initial vertices will be used to * calculate the distance. */ @@ -346,7 +300,7 @@ float *distances_create(Object *ob, GSet *initial_verts, const float limit_radiu SculptSession *ss = ob->sculpt; switch (BKE_pbvh_type(ss->pbvh)) { case PBVH_FACES: - return geodesic_mesh_create_test(ob, initial_verts, limit_radius); + return geodesic_mesh_create(ob, initial_verts, limit_radius); case PBVH_BMESH: case PBVH_GRIDS: return geodesic_fallback_create(ob, initial_verts);