[Bf-blender-cvs] [c07ba23896c] greasepencil-object: GP: Refactor reproject in primitives

Antonioya noreply at git.blender.org
Wed Dec 12 21:50:16 CET 2018


Commit: c07ba23896c1baaad6498c9364709da10cbd015c
Author: Antonioya
Date:   Wed Dec 12 21:50:09 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBc07ba23896c1baaad6498c9364709da10cbd015c

GP: Refactor reproject in primitives

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index 45af166f10c..2b409f4bd7c 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -751,18 +751,13 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
 		}
 	}
 
-	/* if axis locked, reproject to plane locked */
-	if ((!is_depth) && (tgpi->lock_axis > GP_LOCKAXIS_VIEW)) {
-		bGPDspoint *tpt = gps->points;
+	/* reproject to plane */
+	if (!is_depth) {
 		float origin[3];
 		ED_gp_get_drawing_reference(tgpi->scene, tgpi->ob, tgpi->gpl,
 			ts->gpencil_v3d_align, origin);
-
-		for (int i = 0; i < gps->totpoints; i++, tpt++) {
-			ED_gp_project_point_to_plane(tgpi->ob, tgpi->rv3d, origin,
-				ts->gp_sculpt.lock_axis - 1,
-				tpt);
-		}
+		ED_gp_project_stroke_to_plane(
+			tgpi->ob, tgpi->rv3d, gps, origin, ts->gp_sculpt.lock_axis - 1);
 	}
 
 	/* if parented change position relative to parent object */



More information about the Bf-blender-cvs mailing list