diff options
author | Joseph Eagar <joeedh@gmail.com> | 2009-03-30 11:28:37 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2009-03-30 11:28:37 +0400 |
commit | 89b906db9f758fb9642e01d9b4433b97557369fb (patch) | |
tree | 89f0e670a581728e7102a9ca00c5261befb18a57 /source/blender/blenkernel/intern/anim.c | |
parent | 22fec544c8d07e6099580b0e799e309dcfeeed6b (diff) |
editmesh accessor functions. most editmesh access now goes through:
EditMesh *EM_GetEditMesh(Mesh *me);
void EM_EndEditMesh(Mesh *me, EditMesh *em);
as discussed on the mailling list, this is to facilitate migration to bmesh.
next step is to merge this this to the bmesh branch. this was done in the 2.5
branch to prevent too great a divergance.
also, made makesdna/makesrna work on cygwin/msvc2008/scons.
Diffstat (limited to 'source/blender/blenkernel/intern/anim.c')
-rw-r--r-- | source/blender/blenkernel/intern/anim.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 8c71a1d807e..fcd179d48de 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -34,6 +34,7 @@ #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" +#include "BLI_editVert.h" #include "BLI_arithb.h" #include "BLI_rand.h" #include "DNA_listBase.h" @@ -72,6 +73,8 @@ #include <config.h> #endif +#include "ED_mesh.h" + static void object_duplilist_recursive(ID *id, Scene *scene, Object *ob, ListBase *duplilist, float par_space_mat[][4], int level, int animated); void free_path(Path *path) @@ -445,6 +448,7 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl Scene *sce = NULL; Group *group = NULL; GroupObject * go = NULL; + EditMesh *em; float vec[3], no[3], pmat[4][4]; int lay, totvert, a, oblay; @@ -452,12 +456,15 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl /* simple preventing of too deep nested groups */ if(level>MAX_DUPLI_RECUR) return; - - if(me->edit_mesh) - dm= editmesh_get_derived_cage(scene, par, me->edit_mesh, CD_MASK_BAREMESH); - else + + em = EM_GetEditMesh(me); + + if(em) { + dm= editmesh_get_derived_cage(scene, par, em, CD_MASK_BAREMESH); + EM_EndEditMesh(me, em); + } else dm= mesh_get_derived_deform(scene, par, CD_MASK_BAREMESH); - + if(G.rendering) { vdd.orco= (float(*)[3])get_mesh_orco_verts(par); transform_mesh_orco_verts(me, vdd.orco, me->totvert, 0); @@ -557,17 +564,19 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa Scene *sce = NULL; Group *group = NULL; GroupObject *go = NULL; + EditMesh *em; float ob__obmat[4][4]; /* needed for groups where the object matrix needs to be modified */ /* simple preventing of too deep nested groups */ if(level>MAX_DUPLI_RECUR) return; Mat4CpyMat4(pmat, par->obmat); - - if(me->edit_mesh) { + + em = EM_GetEditMesh(me); + if(em) { int totvert; - dm= editmesh_get_derived_cage(scene, par, me->edit_mesh, CD_MASK_BAREMESH); + dm= editmesh_get_derived_cage(scene, par, em, CD_MASK_BAREMESH); totface= dm->getNumFaces(dm); mface= MEM_mallocN(sizeof(MFace)*totface, "mface temp"); @@ -575,6 +584,8 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa totvert= dm->getNumVerts(dm); mvert= MEM_mallocN(sizeof(MVert)*totvert, "mvert temp"); dm->copyVertArray(dm, mvert); + + EM_EndEditMesh(me, em); } else { dm = mesh_get_derived_deform(scene, par, CD_MASK_BAREMESH); |