avoid allocating verts & faces for dupliface + editmode.

This commit is contained in:
Campbell Barton 2011-11-29 06:34:11 +00:00
parent 9dd85d35f9
commit 9125c53d4b

@ -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);