diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2019-08-21 17:06:26 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2019-08-21 17:06:26 +0300 |
commit | b386d5594a79d4963d17477021d2b2f3a64752cb (patch) | |
tree | 62d605107469e7c2a04f5d5f4e4ce6e441125a65 | |
parent | 2ecb4540f37ea7b21fe6c360b97a360c92c5e36c (diff) |
Mask filter: update only modified nodes
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index ed09810548d..0284f0f6c9c 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -8945,11 +8945,13 @@ static void mask_filter_task_cb(void *__restrict userdata, const int mode = data->filter_type; PBVHVertexIter vd; + bool update = false; BKE_pbvh_vertex_iter_begin(ss->pbvh, node, vd, PBVH_ITER_UNIQUE) { float val; - float contrast, delta, gain, offset, max, min; + float contrast, delta, gain, offset, max, min, prev_val; + prev_val = *vd.mask; SculptVertexNeighborIter ni; switch (mode) { case MASK_FILTER_BLUR: @@ -9021,12 +9023,17 @@ static void mask_filter_task_cb(void *__restrict userdata, *vd.mask = gain * (*vd.mask) + offset; break; } + if (*vd.mask != prev_val) { + update = true; + } if (vd.mvert) vd.mvert->flag |= ME_VERT_PBVH_UPDATE; } BKE_pbvh_vertex_iter_end; - BKE_pbvh_node_mark_redraw(node); + if (update) { + BKE_pbvh_node_mark_redraw(node); + } } static int sculpt_mask_filter_invoke(bContext *C, wmOperator *op) |