diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2011-07-29 17:25:58 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2011-07-29 17:25:58 +0400 |
commit | a22f75606e2c179460bfa36a9a4afd4b9548d5f5 (patch) | |
tree | a87052f971d60e917f13323eb7fe3ac56eca1131 /source/blender/modifiers | |
parent | fb99e23205aa1eb7b3f47b8f43e8b812f598a574 (diff) |
vgroup_modifiers: Fixed last problems with WP mode, plus a small fix in weightvg_util.c.
It seems WeightVG modifiers can’t enable the eModifierTypeFlag_SupportsMapping flag...
Diffstat (limited to 'source/blender/modifiers')
4 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c index c18fceb1e3f..1fe1a96c2e5 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.c +++ b/source/blender/modifiers/intern/MOD_weightvg_util.c @@ -187,6 +187,7 @@ void weightvg_update_vg(MDeformVert *dvert, int defgrp_idx, int num, int *indice for (i = 0; i < num; i++) { int j; + char add2vg = do_add; float w = weights[i]; MDeformVert *dv = &dvert[indices ? indices[i] : i]; MDeformWeight *newdw; @@ -221,16 +222,17 @@ void weightvg_update_vg(MDeformVert *dvert, int defgrp_idx, int num, int *indice } } /* Else, just set the new computed weight. */ - else + else { dv->dw[j].weight = w; + } + add2vg = 0; break; } - continue; } /* If the vert wasn’t in the deform group, add it if needed! */ - if (do_add && w > add_thresh) { + if (add2vg && w > add_thresh) { newdw = MEM_callocN(sizeof(MDeformWeight)*(dv->totweight+1), "WeightVGEdit Modifier, deformWeight"); if(dv->dw) { memcpy(newdw, dv->dw, sizeof(MDeformWeight)*dv->totweight); diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c index 5bc185a40af..57c93cdfddf 100644 --- a/source/blender/modifiers/intern/MOD_weightvgedit.c +++ b/source/blender/modifiers/intern/MOD_weightvgedit.c @@ -191,7 +191,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der { WeightVGEditModifierData *wmd = (WeightVGEditModifierData*) md; DerivedMesh *dm = derivedData, *ret = NULL; +#if 0 Mesh *ob_m = NULL; +#endif MDeformVert *dvert = NULL; float *org_w = NULL; /* Array original weights. */ float *new_w = NULL; /* Array new weights. */ @@ -344,7 +346,7 @@ ModifierTypeInfo modifierType_WeightVGEdit = { /* structSize */ sizeof(WeightVGEditModifierData), /* type */ eModifierTypeType_Nonconstructive, /* flags */ eModifierTypeFlag_AcceptsMesh - |eModifierTypeFlag_SupportsMapping +/* |eModifierTypeFlag_SupportsMapping*/ |eModifierTypeFlag_SupportsEditmode, /* copyData */ copyData, diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c index f99060bdf63..29e00040bf6 100644 --- a/source/blender/modifiers/intern/MOD_weightvgmix.c +++ b/source/blender/modifiers/intern/MOD_weightvgmix.c @@ -221,7 +221,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der { WeightVGMixModifierData *wmd = (WeightVGMixModifierData*) md; DerivedMesh *dm = derivedData, *ret = NULL; +#if 0 Mesh *ob_m = NULL; +#endif MDeformVert *dvert = NULL; int numVerts; int defgrp_idx, defgrp_idx2 = -1; @@ -436,7 +438,7 @@ ModifierTypeInfo modifierType_WeightVGMix = { /* structSize */ sizeof(WeightVGMixModifierData), /* type */ eModifierTypeType_Nonconstructive, /* flags */ eModifierTypeFlag_AcceptsMesh - |eModifierTypeFlag_SupportsMapping +/* |eModifierTypeFlag_SupportsMapping*/ |eModifierTypeFlag_SupportsEditmode, /* copyData */ copyData, diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index 84de87a4662..537c5784d29 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -507,7 +507,7 @@ ModifierTypeInfo modifierType_WeightVGProximity = { /* structSize */ sizeof(WeightVGProximityModifierData), /* type */ eModifierTypeType_Nonconstructive, /* flags */ eModifierTypeFlag_AcceptsMesh - |eModifierTypeFlag_SupportsMapping +/* |eModifierTypeFlag_SupportsMapping*/ |eModifierTypeFlag_SupportsEditmode, /* copyData */ copyData, |