[Bf-blender-cvs] [e3546a5097b] master: Vertex Paint minor improvement w/ smear

Campbell Barton noreply at git.blender.org
Fri Sep 29 18:50:10 CEST 2017


Commit: e3546a5097b1b30a3c694ce0f6b98c2f7e70510c
Author: Campbell Barton
Date:   Sat Sep 30 02:58:37 2017 +1000
Branches: master
https://developer.blender.org/rBe3546a5097b1b30a3c694ce0f6b98c2f7e70510c

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.

===================================================================

M	source/blender/editors/sculpt_paint/paint_vertex.c

===================================================================

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



More information about the Bf-blender-cvs mailing list