[Bf-blender-cvs] [ff0d4c7f1ab] greasepencil-object: Fix reproject error drawing lines

Antonio Vazquez noreply at git.blender.org
Mon Apr 2 16:45:37 CEST 2018


Commit: ff0d4c7f1ab5f3e7fcb5f3f9f0a497d906d2cb3d
Author: Antonio Vazquez
Date:   Mon Apr 2 16:40:54 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBff0d4c7f1ab5f3e7fcb5f3f9f0a497d906d2cb3d

Fix reproject error drawing lines

The reproject was done two times and must be done only once.

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

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 314118c3298..891719470cc 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -971,10 +971,6 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
 			
 			/* convert screen-coordinates to appropriate coordinates (and store them) */
 			gp_stroke_convertcoords(p, &ptc->x, &pt->x, NULL);
-			/* reproject to plane (only in 3d space) */
-			gp_reproject_toplane(p, gps);
-			/* if parented change position relative to parent object */
-			gp_apply_parent_point(obact, gpd, gpl, pt);
 			/* copy pressure and time */
 			pt->pressure = ptc->pressure;
 			pt->strength = ptc->strength;
@@ -992,11 +988,6 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
 			
 			/* convert screen-coordinates to appropriate coordinates (and store them) */
 			gp_stroke_convertcoords(p, &ptc->x, &pt->x, NULL);
-			/* reproject to plane (only in 3d space) */
-			gp_reproject_toplane(p, gps);
-			/* if parented change position relative to parent object */
-			gp_apply_parent_point(obact, gpd, gpl, pt);
-
 			/* copy pressure and time */
 			pt->pressure = ptc->pressure;
 			pt->strength = ptc->strength;
@@ -1006,6 +997,15 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
 			pt->weights = NULL;
 
 		}
+
+		/* reproject to plane (only in 3d space) */
+		gp_reproject_toplane(p, gps);
+		pt = gps->points;
+		int i;
+		for (i = 0; i < gps->totpoints; i++, pt++) {
+			/* if parented change position relative to parent object */
+			gp_apply_parent_point(obact, gpd, gpl, pt);
+		}
 	}
 	else if (p->paintmode == GP_PAINTMODE_DRAW_POLY) {
 		/* first point */



More information about the Bf-blender-cvs mailing list