Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2022-05-19 19:05:15 +0300
committerAntonio Vazquez <blendergit@gmail.com>2022-05-19 19:05:15 +0300
commit9e9895b055d490b0793bc7c5662f50abafce9a24 (patch)
tree1fa0f81632428653f1886190297b0c5acb51b6c2
parent65e13cc2d232f85da6c2e437c5fc5cc5debd914e (diff)
GPencil: Avoid Automerge with Closed strokes
The algorithm is not designed to be used with Closed strokes (cyclic) and actually the result is arbitrary. In order to avoid this, now the closed strokes never are merged. Related to T98235 Feedback by: @mendio
-rw-r--r--source/blender/editors/gpencil/gpencil_utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 2dc12125f40..23c385c1213 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -3077,6 +3077,11 @@ bGPDstroke *ED_gpencil_stroke_nearest_to_ends(bContext *C,
continue;
}
+ /* Check that stroke is not closed. Closed strokes must not be included in the merge. */
+ if (gps_target->flag & GP_STROKE_CYCLIC) {
+ continue;
+ }
+
/* Check if one of the ends is inside target stroke bounding box. */
if ((!ED_gpencil_stroke_check_collision(gsc, gps_target, pt2d_start, radius, diff_mat)) &&
(!ED_gpencil_stroke_check_collision(gsc, gps_target, pt2d_end, radius, diff_mat))) {