svn merge -r39781:39792 https://svn.blender.org/svnroot/bf-blender/trunk/blender...
[blender-staging.git] / source / blender / blenkernel / intern / anim.c
index 9ca11db7fceae9350433747a966fa22117499c80..d4721707dc7ec7344dcc73cfcfb8f93826cf9dcd 100644 (file)
@@ -65,6 +65,7 @@
 #include "BKE_particle.h"
 #include "BKE_scene.h"
 #include "BKE_utildefines.h"
+#include "BKE_tessmesh.h"
 #include "BKE_depsgraph.h"
 #include "BKE_anim.h"
 
@@ -888,7 +889,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;
+       BMEditMesh *em;
        float vec[3], no[3], pmat[4][4];
        int totvert, a, oblay;
        unsigned int lay;
@@ -898,11 +899,10 @@ 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;
        
-       em = BKE_mesh_get_editmesh(me);
+       em = me->edit_btmesh;
        
        if(em) {
-               dm= editmesh_get_derived_cage(scene, par, em, CD_MASK_BAREMESH);
-               BKE_mesh_end_editmesh(me, em);
+               dm= editbmesh_get_derived_cage(scene, par, em, CD_MASK_BAREMESH);
        } else
                dm= mesh_get_derived_deform(scene, par, CD_MASK_BAREMESH);
        
@@ -964,7 +964,7 @@ static void vertex_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, fl
                                        /* mballs have a different dupli handling */
                                        if(ob->type!=OB_MBALL) ob->flag |= OB_DONE;     /* doesnt render */
 
-                                       if(me->edit_mesh) {
+                                       if(me->edit_btmesh) {
                                                dm->foreachMappedVert(dm, vertex_dupli__mapFunc, (void*) &vdd);
                                        }
                                        else {
@@ -1013,34 +1013,31 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
        Scene *sce = NULL;
        Group *group = NULL;
        GroupObject *go = NULL;
-       EditMesh *em;
+       BMEditMesh *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;
        
        copy_m4_m4(pmat, par->obmat);
-       
-       em = BKE_mesh_get_editmesh(me);
+       em = me->edit_btmesh;
+
        if(em) {
                int totvert;
+               dm= editbmesh_get_derived_cage(scene, par, em, CD_MASK_BAREMESH);
                
-               dm= editmesh_get_derived_cage(scene, par, em, CD_MASK_BAREMESH);
-               
-               totface= dm->getNumFaces(dm);
+               totface= dm->getNumTessFaces(dm);
                mface= MEM_mallocN(sizeof(MFace)*totface, "mface temp");
-               dm->copyFaceArray(dm, mface);
+               dm->copyTessFaceArray(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);
+               totface= dm->getNumTessFaces(dm);
+               mface= dm->getTessFaceArray(dm);
                mvert= dm->getVertArray(dm);
        }