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>2020-04-15 22:09:43 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-04-20 03:10:42 +0300
commit65aaa13a0001610e9d8727b916e413c4c0d9761e (patch)
tree8f5be8af6094f4667ed789ec8adb0b997c51ed22 /source/blender/editors
parent35cbf3b5dcd21e327922dbc16e5abae047da68c4 (diff)
Fix T75662: Surface Smooth filter not checking face sets
In the main mesh filter loop vertex that do not have the active face set are skipped, so in the following surface smooth displacement loop these vertices were deformed using an uninitialized laplacian_disp value. Now the main loop initializes the laplacian_disp for all vertices and the deformation based on face sets is skipped in the second loop. Reviewed By: jbakker Maniphest Tasks: T75662 Differential Revision: https://developer.blender.org/D7443
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_filter_mesh.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c
index 4f22ad6a9b0..94b6e0eb864 100644
--- a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c
+++ b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c
@@ -223,7 +223,16 @@ static void mesh_filter_task_cb(void *__restrict userdata,
if (ss->filter_cache->active_face_set != SCULPT_FACE_SET_NONE) {
if (!SCULPT_vertex_has_face_set(ss, vd.index, ss->filter_cache->active_face_set)) {
- continue;
+ /* Surface Smooth can't skip the loop for this vertex as it needs to calculate its
+ * laplacian_disp. This value is accessed from the vertex neighbors when deforming the
+ * vertices, so it is needed for all vertices even if they are not going to be displaced.
+ */
+ if (filter_type == MESH_FILTER_SURFACE_SMOOTH) {
+ fade = 0.0f;
+ }
+ else {
+ continue;
+ }
}
/* Skip the edges of the face set when relaxing or smoothing.
* There is a relax face set option to relax the boundaries independently. */
@@ -429,6 +438,13 @@ static void mesh_filter_surface_smooth_displace_task_cb(
if (fade == 0.0f) {
continue;
}
+
+ if (ss->filter_cache->active_face_set != SCULPT_FACE_SET_NONE) {
+ if (!SCULPT_vertex_has_face_set(ss, vd.index, ss->filter_cache->active_face_set)) {
+ continue;
+ }
+ }
+
SCULPT_surface_smooth_displace_step(ss,
vd.co,
ss->filter_cache->surface_smooth_laplacian_disp,