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.
This commit is contained in:
Campbell Barton 2017-09-30 02:58:37 +10:00
parent a270e61b82
commit e3546a5097
Notes: blender-bot 2023-02-14 07:40:56 +01:00
Referenced by issue #52954, Python 3.6: Install problem with PYTHON_VERSION
Referenced by issue #52572, CUDA Illegal address errors Windows
1 changed files with 8 additions and 0 deletions

View File

@ -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);