diff options
Diffstat (limited to 'source/blender/editors/util/ed_util.c')
-rw-r--r-- | source/blender/editors/util/ed_util.c | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 4824d90f5bd..93760ab77e3 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -42,49 +42,56 @@ #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_main.h" #include "ED_armature.h" #include "ED_mesh.h" #include "ED_sculpt.h" #include "ED_util.h" -#include "UI_text.h" +#include "UI_interface.h" /* ********* general editor util funcs, not BKE stuff please! ********* */ +/* frees all editmode stuff */ void ED_editors_exit(bContext *C) { - Object *ob= CTX_data_edit_object(C); + Scene *sce; /* frees all editmode undos */ undo_editmode_clear(); undo_imagepaint_clear(); - /* global in meshtools... */ - mesh_octree_table(ob, NULL, NULL, 'e'); - - if(ob) { - if(ob->type==OB_MESH) { - Mesh *me= ob->data; - if(me->edit_btmesh) { - EDBM_FreeEditBMesh(me->edit_btmesh); - MEM_freeN(me->edit_btmesh); - me->edit_btmesh= NULL; + for(sce=G.main->scene.first; sce; sce= sce->id.next) { + if(sce->obedit) { + Object *ob= sce->obedit; + + /* global in meshtools... */ + mesh_octree_table(ob, NULL, NULL, 'e'); + + if(ob) { + if(ob->type==OB_MESH) { + Mesh *me= ob->data; + if(me->edit_btmesh) { + EDBM_FreeEditBMesh(me->edit_btmesh); + MEM_freeN(me->edit_btmesh); + me->edit_btmesh= NULL; + } + } + else if(ob->type==OB_ARMATURE) { + ED_armature_edit_free(ob); + } + else if(ob->type==OB_FONT) { + // free_editText(); + } + // else if(ob->type==OB_MBALL) + // BLI_freelistN(&editelems); + // free_editLatt(); + // free_posebuf(); } } - else if(ob->type==OB_ARMATURE) { - ED_armature_edit_free(ob); - } - else if(ob->type==OB_FONT) { - // free_editText(); - } - // else if(ob->type==OB_MBALL) - // BLI_freelistN(&editelems); } - // free_editLatt(); - // free_posebuf(); - } @@ -115,7 +122,7 @@ int GetButStringLength(char *str) { int rt; - rt= UI_GetStringWidth(G.font, str, (U.transopts & USER_TR_BUTTONS)); + rt= UI_GetStringWidth(str); return rt + 15; } |