From c9b60a7b64c75bf999cb8390b328aa42e7a5f53f Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Wed, 31 Dec 2008 17:11:42 +0000 Subject: 2.5 So, editmode mesh is back! :) At the moment only TABkey works and mouse select, 1 vertex at a time. More will follow of course. Note for the devs: - G.editMesh has been removed, be careful with old code. - EditMesh now is property of Mesh itself Although it means unlimited editmodes, for migration purposes we better stick to 1 "obedit" per scene, which is in Context too - G.obedit will get removed soon, so use CTX_data_edit_object(C) Or if you can't, just scene->obedit for now - Also removed the CTX_data_edit_mesh(), this has no meaning anymore. EditMesh is not context senstitive anymore, only the edit-object for time being is. - Martin: I've already tucked some EditMesh pointer in T and removed all G.editMesh there. --- source/blender/editors/util/ed_util.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'source/blender/editors/util/ed_util.c') diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 5113326cff1..034b8a1576b 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -31,18 +31,52 @@ #include "MEM_guardedalloc.h" +#include "DNA_curve_types.h" +#include "DNA_mesh_types.h" +#include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_userdef_types.h" #include "BLI_blenlib.h" +#include "BLI_editVert.h" +#include "BKE_context.h" #include "BKE_global.h" +#include "ED_mesh.h" #include "ED_util.h" #include "UI_text.h" /* ********* general editor util funcs, not BKE stuff please! ********* */ + +void ED_editors_exit(bContext *C) +{ + if(CTX_data_edit_object(C)) { + Object *ob= CTX_data_edit_object(C); + + if(ob->type==OB_MESH) { + Mesh *me= ob->data; + if(me->edit_mesh) { + free_editMesh(me->edit_mesh); + MEM_freeN(me->edit_mesh); + me->edit_mesh= NULL; + } + } + if(ob->type==OB_FONT) { + // free_editText(); + } + // else if(ob->type==OB_MBALL) + // BLI_freelistN(&editelems); + } + + // free_editLatt(); + // free_editArmature(); + // free_posebuf(); + +} + + /* ***** XXX: functions are using old blender names, cleanup later ***** */ -- cgit v1.2.3