[Bf-blender-cvs] [5739e30fcb1] experimental_gp_weight: Add missing realloc for weights in RNA api

Antonio Vazquez noreply at git.blender.org
Wed May 16 17:23:01 CEST 2018


Commit: 5739e30fcb1a4757f21150592f9d4d29a8f88b84
Author: Antonio Vazquez
Date:   Wed May 16 17:22:52 2018 +0200
Branches: experimental_gp_weight
https://developer.blender.org/rB5739e30fcb1a4757f21150592f9d4d29a8f88b84

Add missing realloc for weights in RNA api

Fixed wrong weight field name too.

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

M	source/blender/makesrna/intern/rna_gpencil.c

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

diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 94a35f80583..745c0d8f4bb 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -411,7 +411,7 @@ static void rna_GPencil_stroke_point_add(bGPDstroke *stroke, int count, float pr
 		stroke->points = MEM_recallocN_id(stroke->points,
 		                                  sizeof(bGPDspoint) * (stroke->totpoints + count),
 		                                  "gp_stroke_points");
-		stroke->points = MEM_recallocN_id(stroke->dvert,
+		stroke->dvert = MEM_recallocN_id(stroke->dvert,
 										  sizeof(MDeformVert) * (stroke->totpoints + count),
 										  "gp_stroke_weight");
 
@@ -449,6 +449,7 @@ static void rna_GPencil_stroke_point_pop(bGPDstroke *stroke, ReportList *reports
 	stroke->totpoints--;
 
 	stroke->points = MEM_callocN(sizeof(bGPDspoint) * stroke->totpoints, "gp_stroke_points");
+	stroke->dvert = MEM_callocN(sizeof(MDeformVert) * stroke->totpoints, "gp_stroke_weights");
 
 	if (index > 0)
 		memcpy(stroke->points, pt_tmp, sizeof(bGPDspoint) * index);



More information about the Bf-blender-cvs mailing list