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