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-07-11 01:19:45 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-07-13 18:53:24 +0300
commit2b5e21fe00e861e40339cf3b4c6927c46525d3f6 (patch)
treeb213b85e9e708595177046e5875f12f32647b6ec /source/blender/editors/sculpt_paint/sculpt_paint_color.c
parent107695220918f07cab51dfe57f8dbcb465ac8466 (diff)
Sculpt: Add extra deform types to Smear
The smear brush was using the stroke direction to slide colors across the mesh surface (this is called drag in other sculpt tools). Similarly, other deformations can be included. The most common ones in image editing are pinch and expand, which can be used to sharpen transitions between colors. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8270
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_paint_color.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_paint_color.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_color.c b/source/blender/editors/sculpt_paint/sculpt_paint_color.c
index 5cf6a053382..608ba1b934e 100644
--- a/source/blender/editors/sculpt_paint/sculpt_paint_color.c
+++ b/source/blender/editors/sculpt_paint/sculpt_paint_color.c
@@ -388,7 +388,17 @@ static void do_smear_brush_task_cb_exec(void *__restrict userdata,
float interp_color[4];
copy_v4_v4(interp_color, ss->cache->prev_colors[vd.index]);
- sub_v3_v3v3(current_disp, ss->cache->location, ss->cache->last_location);
+ switch (brush->smear_deform_type) {
+ case BRUSH_SMEAR_DEFORM_DRAG:
+ sub_v3_v3v3(current_disp, ss->cache->location, ss->cache->last_location);
+ break;
+ case BRUSH_SMEAR_DEFORM_PINCH:
+ sub_v3_v3v3(current_disp, ss->cache->location, vd.co);
+ break;
+ case BRUSH_SMEAR_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);