Cleanup: Paint: Retrieve vert positions from consistent array

`ss.vert_positions` and `pbvh.vert_positions` are expected to point to the
same evaluated deformed position array here. It's preferrable to use the
span we already have locally. Though eventually we hope to remove the
vertex position array from PBVH.
This commit is contained in:
Hans Goudey
2024-05-28 16:25:09 -04:00
committed by Hans Goudey
parent 144c995c06
commit bdb949bc76
2 changed files with 2 additions and 5 deletions

View File

@@ -1358,7 +1358,6 @@ static void do_vpaint_brush_smear(bContext *C,
if (!sculpt_brush_test_sq_fn(test, vert_positions[vert])) {
continue;
}
const float3 &mv_curr = ss.vert_positions[vert];
/* Calculate the dot prod. between ray norm on surf and current vert
* (ie splash prevention factor), and only paint front facing verts. */
@@ -1410,7 +1409,7 @@ static void do_vpaint_brush_smear(bContext *C,
/* Get the direction from the
* selected vert to the neighbor. */
float other_dir[3];
sub_v3_v3v3(other_dir, mv_curr, ss.vert_positions[v_other_index]);
sub_v3_v3v3(other_dir, vert_positions[vert], vert_positions[v_other_index]);
project_plane_v3_v3v3(other_dir, other_dir, cache->view_normal);
normalize_v3(other_dir);

View File

@@ -1193,8 +1193,6 @@ static void do_wpaint_brush_smear_task(const Scene &scene,
continue;
}
const float3 &mv_curr = ss.vert_positions[vert];
float brush_strength = cache->bstrength;
const float angle_cos = use_normal ? dot_v3v3(sculpt_normal_frontface, vert_normals[vert]) :
1.0f;
@@ -1220,7 +1218,7 @@ static void do_wpaint_brush_smear_task(const Scene &scene,
/* Get the direction from the selected vert to the neighbor. */
float other_dir[3];
sub_v3_v3v3(other_dir, mv_curr, ss.vert_positions[vert_other]);
sub_v3_v3v3(other_dir, vert_positions[vert], vert_positions[vert_other]);
project_plane_v3_v3v3(other_dir, other_dir, cache->view_normal);
normalize_v3(other_dir);