svn merge -r41575:41602 ^/trunk/blender
[blender.git] / source / blender / blenkernel / intern / shrinkwrap.c
index aed246690bd8bce682e0ecaa2fc5781eacf6e93f..fb8bb791f32c3993066f79a3a6cff7863d074559 100644 (file)
@@ -54,6 +54,8 @@
 #include "BKE_deform.h"
 #include "BKE_mesh.h"
 #include "BKE_subsurf.h"
+#include "BKE_mesh.h"
+#include "BKE_tessmesh.h"
 
 /* Util macros */
 #define OUT_OF_MEMORY()        ((void)printf("Shrinkwrap: Out of memory\n"))
@@ -89,11 +91,11 @@ typedef void ( *Shrinkwrap_ForeachVertexCallback) (DerivedMesh *target, float *c
 DerivedMesh *object_get_derived_final(Object *ob)
 {
        Mesh *me= ob->data;
-       EditMesh *em = BKE_mesh_get_editmesh(me);
+       BMEditMesh *em = me->edit_btmesh;
 
-       if(em) {
+       if (em)
+       {
                DerivedMesh *dm = em->derivedFinal;
-               BKE_mesh_end_editmesh(me, em);
                return dm;
        }
 
@@ -587,7 +589,9 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Object *ob, DerivedM
        }
 
        //free memory
-       if(ss_mesh)
+       if(ss_mesh) {
+               ss_mesh->needsFree = 1;
                ss_mesh->release(ss_mesh);
+       }
 }