[Bf-blender-cvs] [e660079] master: StopGap Fix for T44932: Ignore pressure values when drawing straight line segments with GPencil

Joshua Leung noreply at git.blender.org
Thu Aug 6 15:49:55 CEST 2015


Commit: e660079e47700f29fc227e357d0f16dbfb6986d4
Author: Joshua Leung
Date:   Fri Aug 7 01:33:53 2015 +1200
Branches: master
https://developer.blender.org/rBe660079e47700f29fc227e357d0f16dbfb6986d4

StopGap Fix for T44932: Ignore pressure values when drawing straight line segments with GPencil

After some testing of the behaviour of this stuff, it became clear that the current
pressure handling here isn't very useful. The initial point would invariably get a
low pressure value (due to the way that the initial tap needs time to "take"), while
the end of the stroke suffers from similar issues (i.e. when the pen is released).
Meanwhile, the line thickness would flicker while drawing the stroke, as the endpoint
pressure varied.

So, until we find a better way, all straight line segments are now drawn without
pressure sensitivity.

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

M	source/blender/editors/gpencil/gpencil_paint.c

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

diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index f3eb161..b77a722 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -342,29 +342,25 @@ static short gp_stroke_addpoint(tGPsdata *p, const int mval[2], float pressure,
 			
 			/* store settings */
 			copy_v2_v2_int(&pt->x, mval);
-			pt->pressure = pressure;
+			pt->pressure = 1.0f; /* T44932 - Pressure vals are unreliable, so ignore for now */
 			pt->time = (float)(curtime - p->inittime);
 			
 			/* increment buffer size */
 			gpd->sbuffer_size++;
 		}
 		else {
-			/* normally, we just reset the endpoint to the latest value
+			/* just reset the endpoint to the latest value
 			 *	- assume that pointers for this are always valid...
 			 */
 			pt = ((tGPspoint *)(gpd->sbuffer) + 1);
 			
 			/* store settings */
 			copy_v2_v2_int(&pt->x, mval);
-			pt->pressure = pressure;
+			pt->pressure = 1.0f; /* T44932 - Pressure vals are unreliable, so ignore for now */
 			pt->time = (float)(curtime - p->inittime);
 			
-			/* if this is just the second point we've added, increment the buffer size
-			 * so that it will be drawn properly...
-			 * otherwise, just leave it alone, otherwise we get problems
-			 */
-			if (gpd->sbuffer_size != 2)
-				gpd->sbuffer_size = 2;
+			/* now the buffer has 2 points (and shouldn't be allowed to get any larger) */
+			gpd->sbuffer_size = 2;
 		}
 		
 		/* can keep carrying on this way :) */




More information about the Bf-blender-cvs mailing list