Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2019-11-28 18:48:43 +0300
committerPablo Dobarro <pablodp606@gmail.com>2019-12-09 19:01:13 +0300
commite77fdc62b75a3b96e4c3ca5c2fc4025d8091ff99 (patch)
treeda7fb2b76d1d8d967c6b675d64b8112817393674 /source/blender/editors/sculpt_paint/sculpt.c
parent8a7851de3a0bbddab7875a6b99bd55d9298d9e9c (diff)
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
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 2d09f188c48..f813be7d0a2 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -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)
{