merge with trunk at r31523
[blender.git] / source / blender / blenkernel / intern / shrinkwrap.c
index 01652aaa7139e5a33668e94bb0e6b8978b7a2779..454a82c2ad354457ce7b00dad69cdc0769e0df2a 100644 (file)
@@ -39,6 +39,7 @@
 #include "DNA_meshdata_types.h"
 #include "DNA_mesh_types.h"
 #include "DNA_scene_types.h"
+#include "DNA_windowmanager_types.h"
 
 #include "BKE_shrinkwrap.h"
 #include "BKE_DerivedMesh.h"
@@ -47,6 +48,8 @@
 #include "BKE_deform.h"
 #include "BKE_mesh.h"
 #include "BKE_subsurf.h"
+#include "BKE_mesh.h"
+#include "BKE_tessmesh.h"
 
 #include "BLI_math.h"
 #include "BLI_editVert.h"
@@ -90,14 +93,13 @@ typedef void ( *Shrinkwrap_ForeachVertexCallback) (DerivedMesh *target, float *c
 DerivedMesh *object_get_derived_final(struct Scene *scene, Object *ob, CustomDataMask dataMask)
 {
        Mesh *me= ob->data;
-       EditMesh *em = BKE_mesh_get_editmesh(me);
+       BMEditMesh *em = me->edit_btmesh;
 
        if (em)
        {
                DerivedMesh *final = NULL;
-               editmesh_get_derived_cage_and_final(scene, ob, em, &final, dataMask);
-               
-               BKE_mesh_end_editmesh(me, em);
+               editbmesh_get_derived_cage_and_final(scene, ob, em, &final, dataMask);
+
                return final;
        }
        else