From 6e4b9f5836cd9954c00b52e043e6a9af9fb4c112 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Fri, 18 Jun 2021 01:28:10 +0200 Subject: Fix T89221: Sculpt tools symmetry failing with non symmetrical meshes SCULPT_nearest_vertex_get expects a distance, not a distance squared. This should make symmetry work as expected, but it still can fail if the mesh topology is not completely symmetrical. Reviewed By: JacquesLucke Maniphest Tasks: T89221 Differential Revision: https://developer.blender.org/D11642 --- source/blender/editors/sculpt_paint/sculpt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index d6d54a1985d..ab5c46f4bc5 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1146,10 +1146,9 @@ void SCULPT_floodfill_add_active( v = SCULPT_active_vertex_get(ss); } else if (radius > 0.0f) { - float radius_squared = (radius == FLT_MAX) ? FLT_MAX : radius * radius; float location[3]; flip_v3_v3(location, SCULPT_active_vertex_co_get(ss), i); - v = SCULPT_nearest_vertex_get(sd, ob, location, radius_squared, false); + v = SCULPT_nearest_vertex_get(sd, ob, location, radius, false); } if (v != -1) { -- cgit v1.2.3