[Bf-blender-cvs] [d18c8507d7d] PSketch-279: PSculpt: Use "distance to line" instead of "distance to midpoint" for influence calculations

Joshua Leung noreply at git.blender.org
Tue May 8 18:02:54 CEST 2018


Commit: d18c8507d7def04edf8e97c376e55bd02ad19b51
Author: Joshua Leung
Date:   Sun Dec 24 16:09:30 2017 +1300
Branches: PSketch-279
https://developer.blender.org/rBd18c8507d7def04edf8e97c376e55bd02ad19b51

PSculpt: Use "distance to line" instead of "distance to midpoint" for influence calculations

This will work better for Bendy Bones, and is more predictable when trying
to grab larger bones. Further testing is needed though to see if this causes
more problems with other stuff...

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

M	source/blender/editors/armature/pose_sculpt.c

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

diff --git a/source/blender/editors/armature/pose_sculpt.c b/source/blender/editors/armature/pose_sculpt.c
index f2939192811..9f0a973b5ba 100644
--- a/source/blender/editors/armature/pose_sculpt.c
+++ b/source/blender/editors/armature/pose_sculpt.c
@@ -1704,12 +1704,14 @@ static bool psculpt_brush_do_apply(tPoseSculptingOp *pso, PSculptBrushCallback b
 		
 		/* act on bone? */
 		if (ok) {
-			float mid[2];
+			//float mid[2];
 			float dist;
 			
 			/* set distance from cursor to bone - taken as midpoint of bone */
-			mid_v2_v2v2(mid, sco1, sco2);
-			dist = len_v2v2(mid, pso->mval);
+			//mid_v2_v2v2(mid, sco1, sco2);
+			//dist = len_v2v2(mid, pso->mval);
+			
+			dist = dist_to_line_v2(pso->mval, sco1, sco2);
 			
 			/* apply callback to this bone */
 			brush_cb(pso, pchan, dist);



More information about the Bf-blender-cvs mailing list