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>2012-01-14 22:52:34 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-14 22:52:34 +0400
commit13ffef9c4a518c1c17b791cd00abe36f4bbf93e1 (patch)
tree27575ccd16bbcedee58bca73c5f13a7bdd7d0dac /source/blender/editors
parent5c93135ef9a1e7265ead3b92b10ea9a4ef82b909 (diff)
fix for weight paint when the mirror vertex was allocated (would free the original verts weight).
was an error in own recent commit.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 167af434853..21b27b2d3d3 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1655,7 +1655,20 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert
}
}
else {
- dw_mirr = defvert_verify_index(dv_mirr, vgroup_mirr);
+ if (index != index_mirr) {
+ dw_mirr = defvert_verify_index(dv_mirr, vgroup_mirr);
+ }
+ else {
+ /* dv and dv_mirr are the same */
+ int totweight_prev = dv_mirr->totweight;
+ int dw_offset = (int)(dw - dv_mirr->dw);
+ dw_mirr = defvert_verify_index(dv_mirr, vgroup_mirr);
+
+ /* if we added another, get our old one back */
+ if (totweight_prev != dv_mirr->totweight) {
+ dw = &dv_mirr->dw[dw_offset];
+ }
+ }
}
}
else {