Commit: 9e9895b055d490b0793bc7c5662f50abafce9a24
Author: Antonio Vazquez
Date:   Thu May 19 18:05:15 2022 +0200
Branches: master
https://developer.blender.org/rB9e9895b055d490b0793bc7c5662f50abafce9a24

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

===================================================================

M       source/blender/editors/gpencil/gpencil_utils.c

===================================================================

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))) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to