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
path: root/source
diff options
context:
space:
mode:
authorJason Hays <jason_hays22@mymail.eku.edu>2011-07-11 21:27:37 +0400
committerJason Hays <jason_hays22@mymail.eku.edu>2011-07-11 21:27:37 +0400
commit30412f85aaa3916e656aac5b236c147dfd67501f (patch)
treeaccbc68e76a4b90403bf6605a006054c329aa5e7 /source
parent4f8b9a4033f849417710a9ca4ba7c1d6337f89e0 (diff)
Found and fixed a problem with locking (noticed it when it was being used with multi-paint):
it did not have a proper condition to set designatedw
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index c1603e6c7f6..2ccf53a35fd 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1320,7 +1320,7 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defcnt, char *
total_changed++;
if(ndw->weight == 0) {
new_weight_has_zero = TRUE;
- } else if(!designatedw){
+ } else if(designatedw == -1){
designatedw = i;
}
} // unchanged, unlocked bone groups are handled here
@@ -1361,7 +1361,7 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defcnt, char *
left_over += totchange_allowed;
if(left_over) {
// more than one nonzero weights were changed with the same ratio, so keep them changed that way!
- if(total_changed > 1 && !new_weight_has_zero) {
+ if(total_changed > 1 && !new_weight_has_zero && designatedw >= 0) {
// this dw is special, it is used as a base to determine how to change the others
ndw = defvert_find_index(ndv, designatedw);
odw = defvert_find_index(odv, designatedw);
@@ -1378,7 +1378,7 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv, int defcnt, char *
}
}
}
- // a weight was changed to zero, or only one weight was changed
+ // a weight was changed to zero, only one weight was changed, or designatedw is still -1
// put weight back as evenly as possible
else {
redistribute_change(ndv, change_status, 2, -2, validmap, left_over, total_changed);