Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-05-10 18:32:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-05-10 19:47:38 +0300
commitc1e4aaa289f64748093d4cd7590f5836b8873466 (patch)
treebd186bf58ae213e442218b5110aa84113a00ea36 /source/blender/editors/object
parente525a0680034da16ca085f41f70b9723c8721cc7 (diff)
Fix T48387: Mirror weights keeps groups assigned
Swapping the weights kept zero weight verts assigned.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_vgroup.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index bf626aa1af9..414cc476be5 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -2096,14 +2096,19 @@ static void dvert_mirror_op(MDeformVert *dvert, MDeformVert *dvert_mirr,
MDeformWeight *dw = defvert_find_index(dvert, act_vgroup);
MDeformWeight *dw_mirr = defvert_find_index(dvert_mirr, act_vgroup);
- if (dw || dw_mirr) {
- if (dw_mirr == NULL)
- dw_mirr = defvert_verify_index(dvert_mirr, act_vgroup);
- if (dw == NULL)
- dw = defvert_verify_index(dvert, act_vgroup);
-
+ if (dw && dw_mirr) {
SWAP(float, dw->weight, dw_mirr->weight);
}
+ else if (dw) {
+ dw_mirr = defvert_verify_index(dvert_mirr, act_vgroup);
+ dw_mirr->weight = dw->weight;
+ defvert_remove_group(dvert, dw);
+ }
+ else if (dw_mirr) {
+ dw = defvert_verify_index(dvert, act_vgroup);
+ dw->weight = dw_mirr->weight;
+ defvert_remove_group(dvert_mirr, dw_mirr);
+ }
}
}