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
This commit is contained in:
Pablo Dobarro 2021-06-18 01:28:10 +02:00
parent c9f12b21e2
commit 6e4b9f5836
Notes: blender-bot 2023-02-14 05:51:15 +01:00
Referenced by issue #89221, Broken symmetry
1 changed files with 1 additions and 2 deletions

View File

@ -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) {