T60748 Second try to fix start extreme in Noise modifier
authorAntonioya <blendergit@gmail.com>
Fri, 25 Jan 2019 09:44:46 +0000 (10:44 +0100)
committerAntonioya <blendergit@gmail.com>
Fri, 25 Jan 2019 09:44:46 +0000 (10:44 +0100)
The first point was moving inverted because first vector was inverted. Now, the vector is changed for the first point to get the same direction.

source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c

index 94f83f10fb5be36728e7818a3553312889b4219e..8b3752c802807ca9d735f0393fc4bb43c286fbea 100644 (file)
@@ -170,7 +170,12 @@ static void deformStroke(
                }
 
                /* initial vector (p0 -> p1) */
-               sub_v3_v3v3(vec1, &pt1->x, &pt0->x);
+               if (i == 0) {
+                       sub_v3_v3v3(vec1, &pt0->x, &pt1->x);
+               }
+               else {
+                       sub_v3_v3v3(vec1, &pt1->x, &pt0->x);
+               }
                vran = len_v3(vec1);
                /* vector orthogonal to normal */
                cross_v3_v3v3(vec2, vec1, normal);