diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-09-29 19:58:37 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-09-29 19:58:37 +0300 |
commit | e3546a5097b1b30a3c694ce0f6b98c2f7e70510c (patch) | |
tree | 30a6ca4305498d0483d16783adf3b028990cb373 /source | |
parent | a270e61b820c21c976979cc770922c65bc5dd5cf (diff) |
Vertex Paint minor improvement w/ smear
Note that this tool seems like it might need to be rewritten
since results are quite strange.
Projecting on the view vector gives a small improvement though.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 7d50e8d5a45..4d6222a4301 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1459,6 +1459,8 @@ static void do_wpaint_brush_smear_task_cb_ex( float brush_dir[3]; sub_v3_v3v3(brush_dir, cache->location, cache->last_location); + project_plane_v3_v3v3(brush_dir, brush_dir, cache->view_normal); + if (normalize_v3(brush_dir) != 0.0f) { SculptBrushTest test; @@ -1501,6 +1503,8 @@ static void do_wpaint_brush_smear_task_cb_ex( /* Get the direction from the selected vert to the neighbor. */ float other_dir[3]; sub_v3_v3v3(other_dir, mv_curr->co, mv_other->co); + project_plane_v3_v3v3(other_dir, other_dir, cache->view_normal); + normalize_v3(other_dir); const float stroke_dot = dot_v3v3(other_dir, brush_dir); @@ -2485,6 +2489,8 @@ static void do_vpaint_brush_smear_task_cb_ex( const bool use_face_sel = (data->me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0; sub_v3_v3v3(brush_dir, cache->location, cache->last_location); + project_plane_v3_v3v3(brush_dir, brush_dir, cache->view_normal); + if (normalize_v3(brush_dir) != 0.0f) { SculptBrushTest test; @@ -2532,6 +2538,8 @@ static void do_vpaint_brush_smear_task_cb_ex( /* Get the direction from the selected vert to the neighbor. */ float other_dir[3]; sub_v3_v3v3(other_dir, mv_curr->co, mv_other->co); + project_plane_v3_v3v3(other_dir, other_dir, cache->view_normal); + normalize_v3(other_dir); const float stroke_dot = dot_v3v3(other_dir, brush_dir); |