diff options
-rw-r--r-- | source/blender/blenkernel/BKE_modifier.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 11 |
3 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index 931f0e12fd4..4b679c1587f 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -292,6 +292,7 @@ struct Object *modifiers_isDeformedByArmature(struct Object *ob); struct Object *modifiers_isDeformedByLattice(struct Object *ob); int modifiers_usesArmature(struct Object *ob, struct bArmature *arm); int modifiers_isDeformed(struct Object *ob); +void modifier_freeTemporaryData(struct ModifierData *md); int modifiers_indexInObject(struct Object *ob, struct ModifierData *md); diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 4cc134476e4..61ad1bd0ebf 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1877,7 +1877,7 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], int needMapping, CustomDataMask dataMask) { Mesh *me = ob->data; - ModifierData *md = modifiers_getVirtualModifierList(ob); + ModifierData *firstmd, *md; LinkNode *datamasks, *curr; CustomDataMask mask; float (*deformedVerts)[3] = NULL; @@ -1886,6 +1886,8 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], int fluidsimMeshUsed = 0; int required_mode; + md = firstmd = modifiers_getVirtualModifierList(ob); + modifiers_clearErrors(ob); /* we always want to keep original indices */ @@ -2097,6 +2099,9 @@ static void mesh_calc_modifiers(Object *ob, float (*inputVertexCos)[3], } } + for(md=first; md; md=md->next) + modifier_freeTemporaryData(md); + /* Yay, we are done. If we have a DerivedMesh and deformed vertices * need to apply these back onto the DerivedMesh. If we have no * DerivedMesh then we need to build one. diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 4672b5d6da8..ad0092e1711 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7219,3 +7219,14 @@ int modifiers_usesPointCache(Object *ob) return 0; } +void modifier_freeTemporaryData(ModifierData *md) +{ + if(md->type == eModifierType_Armature) { + ArmatureModifierData *amd= (ArmatureModifierData*)md; + + if(amd->prevCos) + MEM_freeN(amd->prevCos); + } +} + + |