diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-04-01 20:35:35 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-04-01 20:35:35 +0300 |
commit | a9963669f9d2360a8a7c84c36db5cd64df5e2139 (patch) | |
tree | bf085aa074cd1451e67072e49d990a413f2af7b4 /source/blender/editors/gpencil/gpencil_merge.c | |
parent | c4374bc919c6ae8162ce5724a51a360e3dd36bfa (diff) |
Fix T75283: GPencil Stroke created by `Merge points` can't have fill material
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_merge.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_merge.c | 14 |
1 files changed, 3 insertions, 11 deletions
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); |