svn merge ^/trunk/blender -r40720:40872
[blender.git] / source / blender / editors / object / object_edit.c
index 76cbfdc88e7fae81f8b71a258de49899e7762c98..7eaa1e1de38692ff98fe868f4e48b4c06be93f90 100644 (file)
@@ -81,6 +81,7 @@
 #include "BKE_sca.h"
 #include "BKE_softbody.h"
 #include "BKE_modifier.h"
+#include "BKE_tessmesh.h"
 
 #include "ED_armature.h"
 #include "ED_curve.h"
@@ -321,22 +322,24 @@ void ED_object_exit_editmode(bContext *C, int flag)
 //             if(retopo_mesh_paint_check())
 //                     retopo_end_okee();
                
-               if(me->edit_mesh->totvert>MESH_MAX_VERTS) {
+               if(me->edit_btmesh->bm->totvert>MESH_MAX_VERTS) {
                        error("Too many vertices");
                        return;
                }
-               load_editMesh(scene, obedit);
+               
+               EDBM_LoadEditBMesh(scene, obedit);
                
                if(freedata) {
-                       free_editMesh(me->edit_mesh);
-                       MEM_freeN(me->edit_mesh);
-                       me->edit_mesh= NULL;
+                       EDBM_FreeEditBMesh(me->edit_btmesh);
+                       MEM_freeN(me->edit_btmesh);
+                       me->edit_btmesh= NULL;
                }
-               
+#if 0 //BMESH_TODO             
                if(obedit->restore_mode & OB_MODE_WEIGHT_PAINT) {
                        mesh_octree_table(NULL, NULL, NULL, 'e');
                        mesh_mirrtopo_table(NULL, 'e');
                }
+#endif
        }
        else if (obedit->type==OB_ARMATURE) {   
                ED_armature_from_edit(obedit);
@@ -445,7 +448,7 @@ void ED_object_enter_editmode(bContext *C, int flag)
                ok= 1;
                scene->obedit= ob;      // context sees this
                
-               make_editMesh(scene, ob);
+               EDBM_MakeEditBMesh(CTX_data_tool_settings(C), scene, ob);
 
                WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_EDITMODE_MESH, scene);
        }