Merge with trunk r41342
[blender-staging.git] / source / blender / blenkernel / intern / DerivedMesh.c
index 0c99735f73e437a2ed92bdcf904013c8bc083f68..9023a444b7b24f6d06e3103cdcd84a6af584dc40 100644 (file)
@@ -1785,7 +1785,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
        Mesh *me = ob->data;
        ModifierData *firstmd, *md;
        LinkNode *datamasks, *curr;
-       CustomDataMask mask, nextmask;
+       CustomDataMask mask, nextmask, append_mask = 0;
        float (*deformedVerts)[3] = NULL;
        DerivedMesh *dm, *orcodm, *clothorcodm, *finaldm;
        int numVerts = me->totvert;
@@ -2004,6 +2004,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
                        mask= (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
                        /* needMapping check here fixes bug [#28112], otherwise its
                         * possible that it wont be copied */
+                       mask |= append_mask;
                        DM_set_only_copy(dm, mask | (needMapping ? CD_MASK_ORIGINDEX : 0));
                        
                        /* add cloth rest shape key if need */
@@ -2062,6 +2063,10 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
                                        clothorcodm = ndm;
                                }
                        }
+
+                       /* in case of dynamic paint, make sure preview mask remains for following modifiers */
+                       if (md->type == eModifierType_DynamicPaint)
+                               append_mask |= CD_MASK_WEIGHT_MCOL;
                }
 
                isPrevDeform= (mti->type == eModifierTypeType_OnlyDeform);