forked from bartvdbraak/blender
avoid allocating verts & faces for dupliface + editmode.
This commit is contained in:
parent
9dd85d35f9
commit
9125c53d4b
@ -1030,26 +1030,16 @@ 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);
|
||||
}
|
||||
|
||||
if(G.rendering) {
|
||||
|
||||
@ -1190,11 +1180,6 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
|
||||
else go= go->next; /* group loop */
|
||||
}
|
||||
|
||||
if(em) {
|
||||
MEM_freeN(mface);
|
||||
MEM_freeN(mvert);
|
||||
}
|
||||
|
||||
if(orco)
|
||||
MEM_freeN(orco);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user