diff options
author | Antonioya <blendergit@gmail.com> | 2019-01-20 22:31:11 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-01-20 22:31:11 +0300 |
commit | 6e443b32103505221fef86d2dcd5f4b8e6df550a (patch) | |
tree | f39036de08af22b7645b79772b2ed5772cac87c7 /source/blender/blenkernel/intern | |
parent | 6e57534eaabef106a4c9c82f3d57e14a362dcceb (diff) |
Fix T60677: GP vertex groups get messed up, when deleting a group
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 989649f65b8..ae386d24309 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1209,6 +1209,15 @@ void BKE_gpencil_vgroup_remove(Object *ob, bDeformGroup *defgroup) if (dw != NULL) { defvert_remove_group(dvert, dw); } + else { + /* reorganize weights in other strokes */ + for (int g = 0; g < gps->dvert->totweight; g++) { + MDeformWeight *dw = &dvert->dw[g]; + if ((dw != NULL) && (dw->def_nr > def_nr)) { + dw->def_nr--; + } + } + } } } } |