[Bf-blender-cvs] [48e52c5a5ce] soc-2020-greasepencil-curve: GPencil: use smooth interpolation

Falk David noreply at git.blender.org
Thu Jul 23 13:59:30 CEST 2020


Commit: 48e52c5a5ced06b49f1fee6a8bd3f3a51838bd8a
Author: Falk David
Date:   Thu Jul 23 13:58:49 2020 +0200
Branches: soc-2020-greasepencil-curve
https://developer.blender.org/rB48e52c5a5ced06b49f1fee6a8bd3f3a51838bd8a

GPencil: use smooth interpolation

For the pressure, strength and color atributes, use smooth interpolation
to generate the stroke points.

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

M	source/blender/blenkernel/intern/gpencil_curve.c

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

diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c
index f7a1133f76a..19f14e92443 100644
--- a/source/blender/blenkernel/intern/gpencil_curve.c
+++ b/source/blender/blenkernel/intern/gpencil_curve.c
@@ -684,11 +684,11 @@ void BKE_gpencil_stroke_editcurve_sync_selection(bGPDstroke *gps, bGPDcurve *gpc
 static void gpencil_interpolate_fl_from_to(
     float from, float to, float *point_offset, int it, int stride)
 {
-  /* linear interpolation */
+  /* smooth interpolation */
   float *r = point_offset;
   for (int i = 0; i <= it; i++) {
     float fac = (float)i / (float)it;
-    // fac = 3.0f * fac * fac - 2.0f * fac * fac * fac; // smooth
+    fac = 3.0f * fac * fac - 2.0f * fac * fac * fac; // smooth
     *r = interpf(to, from, fac);
     r = POINTER_OFFSET(r, stride);
   }
@@ -697,11 +697,11 @@ static void gpencil_interpolate_fl_from_to(
 static void gpencil_interpolate_v4_from_to(
     float from[4], float to[4], float *point_offset, int it, int stride)
 {
-  /* linear interpolation */
+  /* smooth interpolation */
   float *r = point_offset;
   for (int i = 0; i <= it; i++) {
     float fac = (float)i / (float)it;
-    // fac = 3.0f * fac * fac - 2.0f * fac * fac * fac; // smooth
+    fac = 3.0f * fac * fac - 2.0f * fac * fac * fac; // smooth
     interp_v4_v4v4(r, from, to, fac);
     r = POINTER_OFFSET(r, stride);
   }



More information about the Bf-blender-cvs mailing list