diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-11-18 23:30:43 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-11-18 23:35:06 +0300 |
commit | e9607f45d85df6df834a80f147b8c42ff12f56f2 (patch) | |
tree | eeea0e6c742f557798d3e8011bf84c8d806c0b12 /source/blender/editors/gpencil/gpencil_convert.c | |
parent | c126e27cdc8b28365a9d5f9fafc4d521d1eb83df (diff) |
GPencil: Automerge last drawn stroke with previous strokes
This option joins any stroke with an end near the actual stroke. Now it is not limited to the last stroke, any stroke in the same layer for the actual frame can be joined. The join can join two strokes drawing a third stroke.
If the end and the start of the result stroke are very small, the stroke is changed to be cyclic automatically.
There is a limit distance to join the stroke, if the distance is greater than this value, the strokes are not joined. Actually, a constant, threshold distance is used, but we could expose
as a parameter in the UI in the future.
The tool can be used with freehand drawing or with primitives.
Note: Great part of the patch is just a refactor of the old code to make it accessible and to keep code organized.
Reviewed By: mendio
Maniphest Tasks: T82377
Differential Revision: https://developer.blender.org/D9440
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_convert.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_convert.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c index 293ce370a0b..33b02d525d5 100644 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@ -1860,7 +1860,8 @@ static int image_to_gpencil_exec(bContext *C, wmOperator *op) if (done) { /* Delete any selected point. */ LISTBASE_FOREACH_MUTABLE (bGPDstroke *, gps, &gpf->strokes) { - gpencil_stroke_delete_tagged_points(gpd, gpf, gps, gps->next, GP_SPOINT_SELECT, false, 0); + BKE_gpencil_stroke_delete_tagged_points( + gpd, gpf, gps, gps->next, GP_SPOINT_SELECT, false, 0); } BKE_reportf(op->reports, RPT_INFO, "Object created"); |