[Bf-blender-cvs] [2803d7c06f3] greasepencil-object: Update cyclic logic in old draw methods

Antonio Vazquez noreply at git.blender.org
Mon Oct 16 08:43:58 CEST 2017


Commit: 2803d7c06f3fb0ee3ee253b0d469f21aeb1d1763
Author: Antonio Vazquez
Date:   Mon Oct 16 08:43:21 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB2803d7c06f3fb0ee3ee253b0d469f21aeb1d1763

Update cyclic logic in old draw methods

The first adjacency point must be equal to last one if cyclic enabled.

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

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

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

diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 939e0e4df9e..82f1fe1c531 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -750,7 +750,12 @@ static void gp_draw_stroke_3d(
 		if (i == 0) {
 			gp_set_point_varying_color(points, ink, color);
 			immAttrib1f(thickattrib, max_ff(curpressure * thickness, 1.0f));
-			mul_v3_m4v3(fpt, diff_mat, &(points + 1)->x);
+			if ((cyclic) && (totpoints > 2)) {
+				mul_v3_m4v3(fpt, diff_mat, &(points + totpoints - 1)->x);
+			}
+			else {
+				mul_v3_m4v3(fpt, diff_mat, &(points + 1)->x);
+			}
 			mul_v3_fl(fpt, -1.0f);
 			immVertex3fv(pos, fpt);
 		}



More information about the Bf-blender-cvs mailing list