[Bf-blender-cvs] [22bd2be24ef] greasepencil-object: GPencil: Interpolate pressure and strength for arc points

Antonio Vazquez noreply at git.blender.org
Mon Oct 14 15:39:43 CEST 2019


Commit: 22bd2be24ef369dc7e1957923fb7b97a75465b87
Author: Antonio Vazquez
Date:   Mon Oct 14 15:39:29 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB22bd2be24ef369dc7e1957923fb7b97a75465b87

GPencil: Interpolate pressure and strength for arc points

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

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 e725f97282f..9e2599e3d7e 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -808,9 +808,9 @@ static void gp_add_arc_segments(tGPsdata *p)
     pt->x = corner[0] + (end[0] - corner[0]) * sinf(a) + (start[0] - corner[0]) * cosf(a);
     pt->y = corner[1] + (end[1] - corner[1]) * sinf(a) + (start[1] - corner[1]) * cosf(a);
 
-    /* TODO: Interpolate these */
-    pt->pressure = pt_prev->pressure;
-    pt->strength = pt_prev->strength;
+    /* Interpolate values */
+    pt->pressure = interpf(pt_prev->pressure, pt_cur->pressure, M_PI_2 / a);
+    pt->strength = interpf(pt_prev->strength, pt_cur->strength, M_PI_2 / a);
     a += step;
   }
 }
@@ -2903,7 +2903,7 @@ static void gpencil_draw_apply(
     }
   }
 
-  /* GPXX */
+  /* Add an arc when there are missing events due very fast drawing gesture. */
   gp_add_arc_segments(p);
 }



More information about the Bf-blender-cvs mailing list