Fix: GPencil Sequence Interpolation for thickness/strength was inverted
authorJoshua Leung <aligorith@gmail.com>
Sat, 2 Sep 2017 15:38:44 +0000 (03:38 +1200)
committerJoshua Leung <aligorith@gmail.com>
Sun, 3 Sep 2017 00:49:15 +0000 (12:49 +1200)
For example, if you have two keyframes:
  k1 = 1px, k2 = 10px

it was doing:
  1px, 9px, 8px, ..., 3px, 2px, 10px
instead of:
  1px, 2px, 3px, ..., 8px, 9px, 10px

source/blender/editors/gpencil/gpencil_interpolate.c

index 4bcc9f7b81100be668705c157fd121470b42c791..83e2a85db4998f9404ae0e84020f6096b3f6d7c0 100644 (file)
@@ -117,8 +117,8 @@ static void gp_interpolate_update_points(bGPDstroke *gps_from, bGPDstroke *gps_t
                
                /* Interpolate all values */
                interp_v3_v3v3(&pt->x, &prev->x, &next->x, factor);
-               pt->pressure = interpf(prev->pressure, next->pressure, factor);
-               pt->strength = interpf(prev->strength, next->strength, factor);
+               pt->pressure = interpf(prev->pressure, next->pressure, 1.0f - factor);
+               pt->strength = interpf(prev->strength, next->strength, 1.0f - factor);
                CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
        }
 }