mask modifier properly works in weightpaint and edit modes now. note that modifiers...
authorJoseph Eagar <joeedh@gmail.com>
Mon, 3 May 2010 10:09:26 +0000 (10:09 +0000)
committerJoseph Eagar <joeedh@gmail.com>
Mon, 3 May 2010 10:09:26 +0000 (10:09 +0000)
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/modifiers/intern/MOD_mask.c

index 8a74ba1be535f715edb494535aa2f28ca5dcd952..9d6086edb8cdd08c9518751c03cc0cd0a0f95873 100644 (file)
@@ -2017,7 +2017,9 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri
                                }
                        }
 
-                       mti->deformVertsEM(md, ob, em, dm, deformedVerts, numVerts);
+                       if (mti->deformVertsEM)
+                               mti->deformVertsEM(md, ob, em, dm, deformedVerts, numVerts);
+                       else mti->deformVerts(md, ob, dm, deformedVerts, numVerts, 0, 0);
                } else {
                        DerivedMesh *ndm;
 
@@ -2053,7 +2055,11 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri
 
                                mask &= ~CD_MASK_ORCO;
                                DM_set_only_copy(orcodm, mask);
-                               ndm = mti->applyModifierEM(md, ob, em, orcodm);
+
+                               if (mti->applyModifierEM)
+                                       ndm = mti->applyModifierEM(md, ob, em, orcodm);
+                               else
+                                       ndm = mti->applyModifier(md, ob, orcodm, 0, 0);
 
                                if(ndm) {
                                        /* if the modifier returned a new dm, release the old one */
@@ -2069,7 +2075,10 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri
                                if(!CustomData_has_layer(&dm->faceData, CD_ORIGSPACE))
                                        DM_add_face_layer(dm, CD_ORIGSPACE, CD_DEFAULT, NULL);
                        
-                       ndm = mti->applyModifierEM(md, ob, em, dm);
+                       if (mti->applyModifierEM)
+                               ndm = mti->applyModifierEM(md, ob, em, dm);
+                       else
+                               ndm = mti->applyModifier(md, ob, dm, 0, 0);
 
                        if (ndm) {
                                if(dm && dm != ndm)
index 6d6ccb0e3a295136a07cb7eadf78e21cdd73405a..25781f3dff0d55e79a51ad4531a4c49f41931071 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "DNA_armature_types.h"
 #include "DNA_meshdata_types.h"
+#include "DNA_modifier_types.h"
 
 #include "BLI_ghash.h"
 
@@ -386,7 +387,7 @@ ModifierTypeInfo modifierType_Mask = {
        /* structName */        "MaskModifierData",
        /* structSize */        sizeof(MaskModifierData),
        /* type */              eModifierTypeType_Nonconstructive,
-       /* flags */             eModifierTypeFlag_AcceptsMesh,
+       /* flags */             eModifierTypeFlag_AcceptsMesh|eModifierTypeFlag_SupportsMapping|eModifierTypeFlag_SupportsEditmode,
 
        /* copyData */          copyData,
        /* deformVerts */       0,