Fix T72006: Clay brush with size pressure corrupts mesh
When size pressure is enabled, the radius may not be enough to sample any vertices to calculate the area normal. This lead to a vector 0 plane and a division by 0 when calculating the signed distance to the plane, which produces a NaN that was being written to the vertex coordinates. Reviewed By: brecht Maniphest Tasks: T72006 Differential Revision: https://developer.blender.org/D6326
This commit is contained in:
@@ -4616,6 +4616,10 @@ static void calc_clay_surface_task_cb(void *__restrict userdata,
|
||||
test.radius_squared = test_radius * test_radius;
|
||||
plane_from_point_normal_v3(plane, area_co, area_no);
|
||||
|
||||
if (is_zero_v4(plane)) {
|
||||
return;
|
||||
}
|
||||
|
||||
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user