From a9963669f9d2360a8a7c84c36db5cd64df5e2139 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Wed, 1 Apr 2020 19:35:35 +0200 Subject: Fix T75283: GPencil Stroke created by `Merge points` can't have fill material --- source/blender/editors/gpencil/gpencil_merge.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'source/blender/editors/gpencil') diff --git a/source/blender/editors/gpencil/gpencil_merge.c b/source/blender/editors/gpencil/gpencil_merge.c index bd9daa83411..6a5c5f7eb07 100644 --- a/source/blender/editors/gpencil/gpencil_merge.c +++ b/source/blender/editors/gpencil/gpencil_merge.c @@ -132,18 +132,8 @@ static bGPDstroke *gpencil_prepare_stroke(bContext *C, wmOperator *op, int totpo bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, add_frame_mode); /* stroke */ - bGPDstroke *gps = MEM_callocN(sizeof(bGPDstroke), "gp_stroke"); - gps->totpoints = totpoints; - gps->inittime = 0.0f; - gps->thickness = brush->size; - gps->hardeness = brush->gpencil_settings->hardeness; - copy_v2_v2(gps->aspect_ratio, brush->gpencil_settings->aspect_ratio); + bGPDstroke *gps = BKE_gpencil_stroke_new(ob->actcol - 1, totpoints, brush->size); gps->flag |= GP_STROKE_SELECT; - gps->flag |= GP_STROKE_3DSPACE; - gps->mat_nr = ob->actcol - 1; - - /* allocate memory for points */ - gps->points = MEM_callocN(sizeof(bGPDspoint) * totpoints, "gp_stroke_points"); if (cyclic) { gps->flag |= GP_STROKE_CYCLIC; @@ -529,6 +519,8 @@ static int gp_stroke_merge_exec(bContext *C, wmOperator *op) gpencil_dissolve_points(C); } + BKE_gpencil_stroke_geometry_update(gps); + /* free memory */ MEM_SAFE_FREE(original_array); MEM_SAFE_FREE(sorted_array); -- cgit v1.2.3