Commit: c10f834b3278f0e5fbd8c8d37ae0418672d17adf Author: YimingWu Date: Tue Jun 25 14:33:07 2019 +0800 Branches: soc-2019-npr https://developer.blender.org/rBc10f834b3278f0e5fbd8c8d37ae0418672d17adf
GPENCIL: Prevent sampling from crashing. Need a new implementation to calculate acturate segment count. =================================================================== M source/blender/blenkernel/intern/gpencil.c =================================================================== diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 30f0f80fb7e..afef9a8424f 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1538,9 +1538,10 @@ bool BKE_gpencil_sample_stroke(bGPDstroke *gps, float dist) pt1 = &gps->points[i]; copy_v3_v3(this_coord, &pt1->x); length += len_v3v3(last_coord, this_coord); + copy_v3_v3(last_coord, &pt1->x); } - int count = (int)(length / dist) + 1; + int count = (int)(length / dist) + 3; /* Head + tail + float point precision tolerance */ bGPDspoint *new_pt = MEM_callocN(sizeof(bGPDspoint) * count, "gp_stroke_points_sampled"); MDeformVert *new_dv = NULL; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs