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>2011-12-30 15:31:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-30 15:31:48 +0400
commit33563c04d31d8774dad6b2cede6895d158e96641 (patch)
treefe23123ad57ba5c8cd219e673bf9a5c94cc73ccc /source/blender/editors
parentc21cfb4fcdea919e9dac50cd7784cd4902695f1d (diff)
patch from Jason Hays
--- Locking only redistributes or restricts weights when using bone groups. So, in addition to adding a NULL check to my last bit of code, I made has_locked_group() check for bone groups.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 3cb613ac5ca..2232f3ae9ad 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1141,14 +1141,14 @@ static void do_weight_paint_auto_normalize_all_groups(MDeformVert *dvert, const
See if the current deform vertex has a locked group
*/
static char has_locked_group(MDeformVert *dvert, const int defbase_tot,
- const char *lock_flags)
+ const char *bone_groups, const char *lock_flags)
{
int i;
MDeformWeight *dw;
for (i= dvert->totweight, dw= dvert->dw; i != 0; i--, dw++) {
if (dw->def_nr < defbase_tot) {
- if (lock_flags[dw->def_nr] && dw->weight > 0.0f) {
+ if (bone_groups[dw->def_nr] && lock_flags[dw->def_nr] && dw->weight > 0.0f) {
return TRUE;
}
}
@@ -1325,7 +1325,7 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv,
char *change_status;
- if(!lock_flags || !has_locked_group(ndv, defbase_tot, lock_flags)) {
+ if(!lock_flags || !has_locked_group(ndv, defbase_tot, vgroup_validmap, lock_flags)) {
return;
}
/* record if a group was changed, unlocked and not changed, or locked */
@@ -1598,7 +1598,7 @@ static void do_weight_paint_vertex( /* vars which remain the same for every vert
/* If there are no locks or multipaint,
* then there is no need to run the more complicated checks */
if ( (wpi->do_multipaint == FALSE || wpi->defbase_tot_sel <= 1) &&
- (wpi->lock_flags == NULL || has_locked_group(dv, wpi->defbase_tot, wpi->lock_flags) == FALSE))
+ (wpi->lock_flags == NULL || has_locked_group(dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->lock_flags) == FALSE))
{
wpaint_blend(wp, dw, uw, alpha, paintweight, wpi->do_flip, FALSE);