diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-10-18 20:28:00 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-10-20 02:59:53 +0300 |
commit | 74d1fba1de66362a9365c907ce75881ee2cb2fca (patch) | |
tree | 586fcb40a2f45069f0874b8563e0212c45133ffe /source/blender/editors/sculpt_paint/sculpt_boundary.c | |
parent | 2b2f3da721bf3dc4a62c6132e8120c50503e3c15 (diff) |
Fix Boundary brush not working when the whole mesh is inside the brush radius
When creating the boundary edit data, the loop can stop because a new
vertex was found further from the boundary than the brush radius or
because all vertices of the mesh were already processed. In this second
case, the max_propagation_step was not set, so the code that laters
calculates the falloff was not working, preventing the mesh from
deforming.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D9215
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_boundary.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_boundary.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_boundary.c b/source/blender/editors/sculpt_paint/sculpt_boundary.c index 84f2721c31a..5dcaf7d9468 100644 --- a/source/blender/editors/sculpt_paint/sculpt_boundary.c +++ b/source/blender/editors/sculpt_paint/sculpt_boundary.c @@ -346,9 +346,9 @@ static void sculpt_boundary_edit_data_init(SculptSession *ss, float accum_distance = 0.0f; while (true) { - /* This steps is further away from the boundary than the brush radius, so stop adding more - * steps. */ - if (accum_distance > radius) { + /* Stop adding steps to edit info. This happens when a steps is further away from the boundary + * than the brush radius or when the entire mesh was already processed. */ + if (accum_distance > radius || BLI_gsqueue_is_empty(current_iteration)) { boundary->max_propagation_steps = num_propagation_steps; break; } @@ -416,12 +416,6 @@ static void sculpt_boundary_edit_data_init(SculptSession *ss, BLI_gsqueue_push(current_iteration, &next_v); } - /* Stop if no vertices were added in this iteration. At this point, all the mesh should have - * been initialized with the edit data. */ - if (BLI_gsqueue_is_empty(current_iteration)) { - break; - } - num_propagation_steps++; } |