[Bf-blender-cvs] [29c4c78a389] blender-v3.0-release: Fix T94620: GPencil AutoMerge does not work when Draw On Back is enabled

Antonio Vazquez noreply at git.blender.org
Tue Jan 11 10:38:38 CET 2022


Commit: 29c4c78a38964408f685b7f6e18ff5a1451ef1d6
Author: Antonio Vazquez
Date:   Tue Jan 4 17:07:21 2022 +0100
Branches: blender-v3.0-release
https://developer.blender.org/rB29c4c78a38964408f685b7f6e18ff5a1451ef1d6

Fix T94620: GPencil AutoMerge does not work when Draw On Back is enabled

The problem was the stroke was added to head and the `prev` pointer was NULL. Now check if there is the list is empty`next`.

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 3e9f22f25d3..333ae60e84b 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1276,7 +1276,7 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p)
 
   /* Join with existing strokes. */
   if (ts->gpencil_flags & GP_TOOL_FLAG_AUTOMERGE_STROKE) {
-    if (gps->prev != NULL) {
+    if ((gps->prev != NULL) || (gps->next != NULL)) {
       BKE_gpencil_stroke_boundingbox_calc(gps);
       float diff_mat[4][4], ctrl1[2], ctrl2[2];
       BKE_gpencil_layer_transform_matrix_get(depsgraph, p->ob, gpl, diff_mat);



More information about the Bf-blender-cvs mailing list