[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28544] trunk/blender/source/blender: mask modifier properly works in weightpaint and edit modes now.

Joseph Eagar joeedh at gmail.com
Mon May 3 12:09:27 CEST 2010


Revision: 28544
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28544
Author:   joeedh
Date:     2010-05-03 12:09:26 +0200 (Mon, 03 May 2010)

Log Message:
-----------
mask modifier properly works in weightpaint and edit modes now.  note that modifiers should not have to provide a applyModifierEM function, there's really no reason to not pull the result from applyModifier if applyModifierEM doesn't exist, it's not like we don't have a dozen *EM functions that do just that, anyway.  fixes 22192.  {merged 28543 into trunk}

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
    trunk/blender/source/blender/modifiers/intern/MOD_mask.c

Modified: trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c	2010-05-03 10:04:25 UTC (rev 28543)
+++ trunk/blender/source/blender/blenkernel/intern/DerivedMesh.c	2010-05-03 10:09:26 UTC (rev 28544)
@@ -2017,7 +2017,9 @@
 				}
 			}
 
-			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,8 +2055,12 @@
 
 				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 */
 					if(orcodm && orcodm != ndm) orcodm->release(orcodm);
@@ -2069,7 +2075,10 @@
 				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)

Modified: trunk/blender/source/blender/modifiers/intern/MOD_mask.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_mask.c	2010-05-03 10:04:25 UTC (rev 28543)
+++ trunk/blender/source/blender/modifiers/intern/MOD_mask.c	2010-05-03 10:09:26 UTC (rev 28544)
@@ -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 @@
 	/* structName */        "MaskModifierData",
 	/* structSize */        sizeof(MaskModifierData),
 	/* type */              eModifierTypeType_Nonconstructive,
-	/* flags */             eModifierTypeFlag_AcceptsMesh,
+	/* flags */             eModifierTypeFlag_AcceptsMesh|eModifierTypeFlag_SupportsMapping|eModifierTypeFlag_SupportsEditmode,
 
 	/* copyData */          copyData,
 	/* deformVerts */       0,





More information about the Bf-blender-cvs mailing list