[Bf-blender-cvs] [619cc12b570] experimental_gp_weight: Add missing main weight array duplication

Antonio Vazquez noreply at git.blender.org
Wed May 16 10:51:22 CEST 2018


Commit: 619cc12b57054adf634b1fd95bb06d1625d441f6
Author: Antonio Vazquez
Date:   Wed May 16 10:16:31 2018 +0200
Branches: experimental_gp_weight
https://developer.blender.org/rB619cc12b57054adf634b1fd95bb06d1625d441f6

Add missing main weight array duplication

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

M	source/blender/editors/gpencil/editaction_gpencil.c
M	source/blender/editors/gpencil/gpencil_brush.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_interpolate.c
M	source/blender/modifiers/intern/MOD_gpencilinstance.c

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

diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c
index 3171a1480b7..17830863d00 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -492,6 +492,7 @@ bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, const short offset_mode)
 					/* make a copy of stroke, then of its points array */
 					gpsn = MEM_dupallocN(gps);
 					gpsn->points = MEM_dupallocN(gps->points);
+					gpsn->dvert = MEM_dupallocN(gps->dvert);
 					BKE_gpencil_stroke_weights_duplicate(gps, gpsn);
 					/* duplicate triangle information */
 					gpsn->triangles = MEM_dupallocN(gps->triangles);
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index 2b23410ddea..a432c5d741d 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -1034,6 +1034,7 @@ static void gp_brush_clone_add(bContext *C, tGP_BrushEditData *gso)
 			new_stroke = MEM_dupallocN(gps);
 			
 			new_stroke->points = MEM_dupallocN(gps->points);
+			new_stroke->dvert = MEM_dupallocN(gps->dvert);
 			BKE_gpencil_stroke_weights_duplicate(gps, new_stroke);
 			new_stroke->triangles = MEM_dupallocN(gps->triangles);
 			
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 6e6785c3535..3a8b09b90ee 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -637,6 +637,7 @@ static int gp_duplicate_exec(bContext *C, wmOperator *op)
 					gpsd = MEM_dupallocN(gps);
 					BLI_strncpy(gpsd->runtime.tmp_layerinfo, gpl->info, sizeof(gpsd->runtime.tmp_layerinfo));
 					gpsd->points = MEM_dupallocN(gps->points);
+					gpsd->dvert = MEM_dupallocN(gps->dvert);
 					BKE_gpencil_stroke_weights_duplicate(gps, gpsd);
 
 					/* triangle information - will be calculated on next redraw */
@@ -815,6 +816,7 @@ static int gp_strokes_copy_exec(bContext *C, wmOperator *op)
 					gpsd = MEM_dupallocN(gps);
 					BLI_strncpy(gpsd->runtime.tmp_layerinfo, gpl->info, sizeof(gpsd->runtime.tmp_layerinfo)); /* saves original layer name */
 					gpsd->points = MEM_dupallocN(gps->points);
+					gpsd->dvert = MEM_dupallocN(gps->dvert);
 					BKE_gpencil_stroke_weights_duplicate(gps, gpsd);
 
 					/* triangles cache - will be recalculated on next redraw */
@@ -988,6 +990,7 @@ static int gp_strokes_paste_exec(bContext *C, wmOperator *op)
 				new_stroke->runtime.tmp_layerinfo[0] = '\0';
 				
 				new_stroke->points = MEM_dupallocN(gps->points);
+				new_stroke->dvert = MEM_dupallocN(gps->dvert);
 				BKE_gpencil_stroke_weights_duplicate(gps, new_stroke);
 
 				new_stroke->flag |= GP_STROKE_RECALC_CACHES;
@@ -2518,6 +2521,7 @@ static int gp_stroke_join_exec(bContext *C, wmOperator *op)
 					if (new_stroke == NULL) {
 						new_stroke = MEM_dupallocN(stroke_a);
 						new_stroke->points = MEM_dupallocN(stroke_a->points);
+						new_stroke->dvert = MEM_dupallocN(stroke_a->dvert);
 						BKE_gpencil_stroke_weights_duplicate(stroke_a, new_stroke);
 						new_stroke->triangles = NULL;
 						new_stroke->tot_triangles = 0;
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index 1b22b76ecb3..21ec40beab9 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -299,6 +299,7 @@ static void gp_interpolate_set_points(bContext *C, tGPDinterpolate *tgpi)
 				/* if destination stroke is smaller, resize new_stroke to size of gps_to stroke */
 				if (gps_from->totpoints > gps_to->totpoints) {
 					new_stroke->points = MEM_recallocN(new_stroke->points, sizeof(*new_stroke->points) * gps_to->totpoints);
+					new_stroke->dvert = MEM_recallocN(new_stroke->dvert, sizeof(*new_stroke->dvert) * gps_to->totpoints);
 					new_stroke->totpoints = gps_to->totpoints;
 					new_stroke->tot_triangles = 0;
 					new_stroke->flag |= GP_STROKE_RECALC_CACHES;
@@ -310,6 +311,7 @@ static void gp_interpolate_set_points(bContext *C, tGPDinterpolate *tgpi)
 				/* need an empty stroke to keep index correct for lookup, but resize to smallest size */
 				new_stroke->totpoints = 0;
 				new_stroke->points = MEM_recallocN(new_stroke->points, sizeof(*new_stroke->points));
+				new_stroke->dvert = MEM_recallocN(new_stroke->dvert, sizeof(*new_stroke->dvert));
 				new_stroke->tot_triangles = 0;
 				new_stroke->triangles = MEM_recallocN(new_stroke->triangles, sizeof(*new_stroke->triangles));
 				new_stroke->flag |= GP_STROKE_RECALC_CACHES;
@@ -579,6 +581,7 @@ static int gpencil_interpolate_modal(bContext *C, wmOperator *op, const wmEvent
 					/* make copy of source stroke, then adjust pointer to points too */
 					gps_dst = MEM_dupallocN(gps_src);
 					gps_dst->points = MEM_dupallocN(gps_src->points);
+					gps_dst->dvert = MEM_dupallocN(gps_src->dvert);
 					BKE_gpencil_stroke_weights_duplicate(gps_src, gps_dst);
 					gps_dst->triangles = MEM_dupallocN(gps_src->triangles);
 					gps_dst->flag |= GP_STROKE_RECALC_CACHES;
diff --git a/source/blender/modifiers/intern/MOD_gpencilinstance.c b/source/blender/modifiers/intern/MOD_gpencilinstance.c
index f907fd1c6f4..3950f0c1482 100644
--- a/source/blender/modifiers/intern/MOD_gpencilinstance.c
+++ b/source/blender/modifiers/intern/MOD_gpencilinstance.c
@@ -208,6 +208,7 @@ static void generate_geometry(
 						/* Duplicate stroke */
 						bGPDstroke *gps_dst = MEM_dupallocN(gps);
 						gps_dst->points = MEM_dupallocN(gps->points);
+						gps_dst->dvert = MEM_dupallocN(gps->dvert);
 						BKE_gpencil_stroke_weights_duplicate(gps, gps_dst);
 						
 						gps_dst->triangles = MEM_dupallocN(gps->triangles);



More information about the Bf-blender-cvs mailing list