diff options
author | Antonioya <blendergit@gmail.com> | 2018-08-26 17:39:01 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-08-26 17:40:06 +0300 |
commit | 1948681440c011ae3008cd5d2a575eb6d45dc7ec (patch) | |
tree | c1ae82fe27da01caf3efdeab5d99a6b6e30950d8 /source/blender/makesrna/intern | |
parent | 85aafba04c18a849eda08fe3f7d46a515ba455d6 (diff) |
GP: Reduce weight paint data memory footprint
Before, the weight data array was created always, but now only is added when a weight value is assigned.
This change was suggested by algorithm, and both agreed it was good idea.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 6beb8c5313e..6bb93e9e313 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -494,7 +494,9 @@ 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 (pt_dvert != NULL) { + stroke->dvert = MEM_callocN(sizeof(MDeformVert) * stroke->totpoints, "gp_stroke_weights"); + } if (index > 0) { memcpy(stroke->points, pt_tmp, sizeof(bGPDspoint) * index); |