diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-07-21 23:57:50 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-07-21 23:59:07 +0300 |
commit | 878d191baee6b6a7997cf21d980f39ea97a0a33b (patch) | |
tree | b4106e231b219acb884e10006056f18d4a7b3e6d /source/blender/editors/sculpt_paint/sculpt.c | |
parent | 46b126a2c8402a527cd611b47d04ee7de29a9775 (diff) |
Sculpt: Add extra deform types to Slide
This adds extra deform modes to the slide mode of the Topology
Slide/Relax brush (both slide and smear are almost identical).
This is useful to move topology to a specific area to add more localized
details
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8349
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index e679c62fdaa..da5d6588dc8 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3100,11 +3100,23 @@ static void do_topology_slide_task_cb_ex(void *__restrict userdata, thread_id); float current_disp[3]; float current_disp_norm[3]; - float final_disp[3]; - zero_v3(final_disp); - sub_v3_v3v3(current_disp, ss->cache->location, ss->cache->last_location); + float final_disp[3] = {0.0f, 0.0f, 0.0f}; + + switch (brush->slide_deform_type) { + case BRUSH_SLIDE_DEFORM_DRAG: + sub_v3_v3v3(current_disp, ss->cache->location, ss->cache->last_location); + break; + case BRUSH_SLIDE_DEFORM_PINCH: + sub_v3_v3v3(current_disp, ss->cache->location, vd.co); + break; + case BRUSH_SLIDE_DEFORM_EXPAND: + sub_v3_v3v3(current_disp, vd.co, ss->cache->location); + break; + } + normalize_v3_v3(current_disp_norm, current_disp); mul_v3_v3fl(current_disp, current_disp_norm, ss->cache->bstrength); + SculptVertexNeighborIter ni; SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, vd.index, ni) { float vertex_disp[3]; |