[Bf-blender-cvs] [60d71ffbe99] master: Fix T67811: GPencil Weights shift when use dissolve in Edit Mode

Antonioya noreply at git.blender.org
Mon Jul 29 12:19:49 CEST 2019


Commit: 60d71ffbe99395bbfeed1eb0504b8f52eb84a827
Author: Antonioya
Date:   Sun Jul 28 10:57:26 2019 +0200
Branches: master
https://developer.blender.org/rB60d71ffbe99395bbfeed1eb0504b8f52eb84a827

Fix T67811: GPencil Weights shift when use dissolve in Edit Mode

The problem was the index was not right calculated for unselected points.

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 779ce27ddf1..f9534b74c04 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -1940,9 +1940,11 @@ static int gp_dissolve_selected_points(bContext *C, eGP_DissolveMode mode)
                         *ndvert = *dvert;
                         ndvert->dw = MEM_dupallocN(dvert->dw);
                         ndvert++;
-                        dvert++;
                       }
                     }
+                    if (gps->dvert != NULL) {
+                      dvert++;
+                    }
                   }
                   break;
                 case GP_DISSOLVE_BETWEEN:
@@ -1970,9 +1972,11 @@ static int gp_dissolve_selected_points(bContext *C, eGP_DissolveMode mode)
                         *ndvert = *dvert;
                         ndvert->dw = MEM_dupallocN(dvert->dw);
                         ndvert++;
-                        dvert++;
                       }
                     }
+                    if (gps->dvert != NULL) {
+                      dvert++;
+                    }
                   }
                   /* copy last segment */
                   (gps->dvert != NULL) ? dvert = gps->dvert + last : NULL;
@@ -2001,9 +2005,11 @@ static int gp_dissolve_selected_points(bContext *C, eGP_DissolveMode mode)
                         *ndvert = *dvert;
                         ndvert->dw = MEM_dupallocN(dvert->dw);
                         ndvert++;
-                        dvert++;
                       }
                     }
+                    if (gps->dvert != NULL) {
+                      dvert++;
+                    }
                   }
                   break;
               }



More information about the Bf-blender-cvs mailing list