From 9125c53d4bbf80c171050d61b760475356a551f9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 29 Nov 2011 06:34:11 +0000 Subject: [PATCH] avoid allocating verts & faces for dupliface + editmode. --- source/blender/blenkernel/intern/anim.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 36df1101a24..f9b41c36791 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1030,27 +1030,17 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa em = BKE_mesh_get_editmesh(me); if(em) { - int totvert; - dm= editmesh_get_derived_cage(scene, par, em, CD_MASK_BAREMESH); - - totface= dm->getNumFaces(dm); - mface= MEM_mallocN(sizeof(MFace)*totface, "mface temp"); - dm->copyFaceArray(dm, mface); - totvert= dm->getNumVerts(dm); - mvert= MEM_mallocN(sizeof(MVert)*totvert, "mvert temp"); - dm->copyVertArray(dm, mvert); - BKE_mesh_end_editmesh(me, em); } else { dm = mesh_get_derived_deform(scene, par, CD_MASK_BAREMESH); - - totface= dm->getNumFaces(dm); - mface= dm->getFaceArray(dm); - mvert= dm->getVertArray(dm); } + totface= dm->getNumFaces(dm); + mface= dm->getFaceArray(dm); + mvert= dm->getVertArray(dm); + if(G.rendering) { orco= (float(*)[3])get_mesh_orco_verts(par); @@ -1189,11 +1179,6 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa if (sce) base= base->next; /* scene loop */ else go= go->next; /* group loop */ } - - if(em) { - MEM_freeN(mface); - MEM_freeN(mvert); - } if(orco) MEM_freeN(orco);