[Bf-blender-cvs] [82bffc68d8d] experimental_gp_weight: Fix dissolve operator

Antonio Vazquez noreply at git.blender.org
Wed May 16 11:02:32 CEST 2018


Commit: 82bffc68d8d9e94482114e4df031c33bab824e64
Author: Antonio Vazquez
Date:   Wed May 16 11:02:24 2018 +0200
Branches: experimental_gp_weight
https://developer.blender.org/rB82bffc68d8d9e94482114e4df031c33bab824e64

Fix dissolve operator

The indices were wrong

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

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 4bca3861f38..a2fd94f6d22 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -1553,6 +1553,7 @@ static int gp_dissolve_selected_points(bContext *C, eGP_DissolveMode mode)
 								case GP_DISSOLVE_POINTS:
 									for (i = 0, pt = gps->points, dvert = gps->dvert; i < gps->totpoints; i++, pt++, dvert++) {
 										if ((pt->flag & GP_SPOINT_SELECT) == 0) {
+											*npt = *pt;
 											*ndvert = *dvert;
 											ndvert->dw = MEM_dupallocN(dvert->dw);
 											npt++;
@@ -1570,7 +1571,7 @@ static int gp_dissolve_selected_points(bContext *C, eGP_DissolveMode mode)
 										ndvert++;
 									}
 									/* copy segment (selected points) */
-									for (i = first, pt = gps->points, dvert = gps->dvert + first; i < last; i++, pt++, dvert++) {
+									for (i = first, pt = gps->points + first, dvert = gps->dvert + first; i < last; i++, pt++, dvert++) {
 										if (pt->flag & GP_SPOINT_SELECT) {
 											*npt = *pt;
 											*ndvert = *dvert;
@@ -1580,7 +1581,7 @@ static int gp_dissolve_selected_points(bContext *C, eGP_DissolveMode mode)
 										}
 									}
 									/* copy last segment */
-									for (i = last, pt = gps->points, dvert = gps->dvert + last; i < gps->totpoints; i++, pt++, dvert++) {
+									for (i = last, pt = gps->points + last, dvert = gps->dvert + last; i < gps->totpoints; i++, pt++, dvert++) {
 										*npt = *pt;
 										*ndvert = *dvert;
 										ndvert->dw = MEM_dupallocN(dvert->dw);



More information about the Bf-blender-cvs mailing list