[Bf-blender-cvs] [51e39ce5681] greasepencil-object: Copy drawing data to stroke buffer

Antonioya noreply at git.blender.org
Thu Dec 6 12:32:26 CET 2018


Commit: 51e39ce568122f2b54d0159003dd3f267afe6c80
Author: Antonioya
Date:   Thu Dec 6 12:32:14 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB51e39ce568122f2b54d0159003dd3f267afe6c80

Copy drawing data to stroke buffer

Still the draw manager is not calling to draw this datablock.

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

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 c865271e822..a2239e0191e 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -403,10 +403,25 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
 	}
 
 	/* convert screen-coordinates to 3D coordinates */
+	gp_session_validatebuffer(tgpi);
+	
+
 	for (int i = 0; i < gps->totpoints; i++) {
 		bGPDspoint *pt = &gps->points[i];
 		tPGPspoint *p2d = &points2D[i];
 
+		/* Copy points to buffer */
+		tGPspoint *tpt = ((tGPspoint *)(gpd->runtime.sbuffer) + gpd->runtime.sbuffer_size);
+		tpt->x = p2d->x;
+		tpt->y = p2d->y;
+		tpt->pressure = p2d->pressure;
+		tpt->strength = p2d->strength;
+		tpt->time = p2d->time;
+		tpt->uv_fac = p2d->uv_fac;
+		tpt->uv_rot = p2d->uv_rot;
+
+		gpd->runtime.sbuffer_size++;
+
 		/* convert screen-coordinates to 3D coordinates */
 		gp_stroke_convertcoords_tpoint_primitive(tgpi->scene, tgpi->ar, tgpi->ob, tgpi->gpl, p2d, &pt->x);



More information about the Bf-blender-cvs mailing list