vgroup_modifiers: Fixed last problems with WP mode, plus a small fix in weightvg_util.c.
authorBastien Montagne <montagne29@wanadoo.fr>
Fri, 29 Jul 2011 13:25:58 +0000 (13:25 +0000)
committerBastien Montagne <montagne29@wanadoo.fr>
Fri, 29 Jul 2011 13:25:58 +0000 (13:25 +0000)
It seems WeightVG modifiers can’t enable the eModifierTypeFlag_SupportsMapping flag...

source/blender/modifiers/intern/MOD_weightvg_util.c
source/blender/modifiers/intern/MOD_weightvgedit.c
source/blender/modifiers/intern/MOD_weightvgmix.c
source/blender/modifiers/intern/MOD_weightvgproximity.c

index c18fceb1e3f60b90d022e297d8c0c2d78db8fb74..1fe1a96c2e550a35ef0063a0a9089b4a536c5479 100644 (file)
@@ -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);
index 5bc185a40af64026916451d71284cd280057fa4e..57c93cdfddf51617deda5606d5aaa394c0f435b2 100644 (file)
@@ -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,
index f99060bdf63738de6b3eb8d306e82a4a16b61579..29e00040bf6c773f81cf3dae81231e7daf4d8fa3 100644 (file)
@@ -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,
index 84de87a4662a2bfa8788eb4ae8b073c4b2fa88e4..537c5784d29f0dcdbccfc1ee7c703359423e12c1 100644 (file)
@@ -507,7 +507,7 @@ ModifierTypeInfo modifierType_WeightVGProximity = {
        /* structSize */        sizeof(WeightVGProximityModifierData),
        /* type */              eModifierTypeType_Nonconstructive,
        /* flags */             eModifierTypeFlag_AcceptsMesh
-                              |eModifierTypeFlag_SupportsMapping
+/*                            |eModifierTypeFlag_SupportsMapping*/
                               |eModifierTypeFlag_SupportsEditmode,
 
        /* copyData */          copyData,