vgroup_modifiers: Fixed last problems with WP mode, plus a small fix in weightvg_util.c.
[blender.git] / source / blender / modifiers / intern / MOD_weightvgedit.c
index e84ecffa74b45064990af5d9b6744cc2aa1c584d..57c93cdfddf51617deda5606d5aaa394c0f435b2 100644 (file)
@@ -71,8 +71,8 @@ static void initData(ModifierData *md)
        wmd->cmap_curve             = curvemapping_add(1, 0.0, 0.0, 1.0, 1.0);
        curvemapping_initialize(wmd->cmap_curve);
 
        wmd->cmap_curve             = curvemapping_add(1, 0.0, 0.0, 1.0, 1.0);
        curvemapping_initialize(wmd->cmap_curve);
 
-       wmd->clamp_min_weight       = 0.0f;
-       wmd->clamp_max_weight       = 1.0f;
+       wmd->clamp_weight_min       = 0.0f;
+       wmd->clamp_weight_max       = 1.0f;
 
        wmd->add_threshold          = 0.01f;
        wmd->rem_threshold          = 0.01f;
 
        wmd->add_threshold          = 0.01f;
        wmd->rem_threshold          = 0.01f;
@@ -104,8 +104,8 @@ static void copyData(ModifierData *md, ModifierData *target)
        twmd->map_new_max            = wmd->map_new_max;
        twmd->cmap_curve             = curvemapping_copy(wmd->cmap_curve);
 
        twmd->map_new_max            = wmd->map_new_max;
        twmd->cmap_curve             = curvemapping_copy(wmd->cmap_curve);
 
-       twmd->clamp_min_weight       = wmd->clamp_min_weight;
-       twmd->clamp_max_weight       = wmd->clamp_max_weight;
+       twmd->clamp_weight_min       = wmd->clamp_weight_min;
+       twmd->clamp_weight_max       = wmd->clamp_weight_max;
 
        twmd->add_threshold          = wmd->add_threshold;
        twmd->rem_threshold          = wmd->rem_threshold;
 
        twmd->add_threshold          = wmd->add_threshold;
        twmd->rem_threshold          = wmd->rem_threshold;
@@ -191,7 +191,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
 {
        WeightVGEditModifierData *wmd = (WeightVGEditModifierData*) md;
        DerivedMesh *dm = derivedData, *ret = NULL;
 {
        WeightVGEditModifierData *wmd = (WeightVGEditModifierData*) md;
        DerivedMesh *dm = derivedData, *ret = NULL;
+#if 0
        Mesh *ob_m = NULL;
        Mesh *ob_m = NULL;
+#endif
        MDeformVert *dvert = NULL;
        float *org_w = NULL; /* Array original weights. */
        float *new_w = NULL; /* Array new weights. */
        MDeformVert *dvert = NULL;
        float *org_w = NULL; /* Array original weights. */
        float *new_w = NULL; /* Array new weights. */
@@ -311,7 +313,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
        /* Do clamping. */
        if (do_clamp) {
                for (i = 0; i < numVerts; i++)
        /* Do clamping. */
        if (do_clamp) {
                for (i = 0; i < numVerts; i++)
-                       CLAMP(org_w[i], wmd->clamp_min_weight, wmd->clamp_max_weight);
+                       CLAMP(org_w[i], wmd->clamp_weight_min, wmd->clamp_weight_max);
        }
 
        /* Update/add/remove from vgroup. */
        }
 
        /* Update/add/remove from vgroup. */
@@ -344,7 +346,7 @@ ModifierTypeInfo modifierType_WeightVGEdit = {
        /* structSize */        sizeof(WeightVGEditModifierData),
        /* type */              eModifierTypeType_Nonconstructive,
        /* flags */             eModifierTypeFlag_AcceptsMesh
        /* structSize */        sizeof(WeightVGEditModifierData),
        /* type */              eModifierTypeType_Nonconstructive,
        /* flags */             eModifierTypeFlag_AcceptsMesh
-                              |eModifierTypeFlag_SupportsMapping
+/*                            |eModifierTypeFlag_SupportsMapping*/
                               |eModifierTypeFlag_SupportsEditmode,
 
        /* copyData */          copyData,
                               |eModifierTypeFlag_SupportsEditmode,
 
        /* copyData */          copyData,