diff options
author | Arystanbek Dyussenov <arystan.d@gmail.com> | 2010-09-04 22:49:07 +0400 |
---|---|---|
committer | Arystanbek Dyussenov <arystan.d@gmail.com> | 2010-09-04 22:49:07 +0400 |
commit | 90b464d3728d9ed8ec26fdf59058d236b99dbcd9 (patch) | |
tree | e88cab4fb1358e962b19f658064ca8c9f8d29f5b /source/blender/editors/util/ed_util.c | |
parent | 08d02dd04d836976b25793bb1d4c6a86b3f924c7 (diff) | |
parent | b0b787ef38f9947b3176642556f5282eb3518f69 (diff) |
COLLADA branch: merge from trunk -r 28015:31610.soc-2009-chingachgook
Diffstat (limited to 'source/blender/editors/util/ed_util.c')
-rw-r--r-- | source/blender/editors/util/ed_util.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 19bd18ade1f..0d3d8a48b60 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -38,11 +38,11 @@ #include "BLI_editVert.h" #include "BKE_context.h" -#include "BKE_global.h" #include "BKE_main.h" #include "ED_armature.h" #include "ED_mesh.h" +#include "ED_object.h" #include "ED_sculpt.h" #include "ED_util.h" @@ -50,16 +50,43 @@ /* ********* general editor util funcs, not BKE stuff please! ********* */ +void ED_editors_init(bContext *C) +{ + Main *bmain= CTX_data_main(C); + Scene *sce= CTX_data_scene(C); + Object *ob, *obact= (sce && sce->basact)? sce->basact->object: NULL; + ID *data; + + /* toggle on modes for objects that were saved with these enabled. for + e.g. linked objects we have to ensure that they are actually the + active object in this scene. */ + for(ob=bmain->object.first; ob; ob=ob->id.next) { + int mode= ob->mode; + + if(mode && (mode != OB_MODE_POSE)) { + ob->mode= 0; + data= ob->data; + + if(ob == obact && !ob->id.lib && !(data && data->lib)) + ED_object_toggle_modes(C, mode); + } + } +} + /* frees all editmode stuff */ void ED_editors_exit(bContext *C) { + Main *bmain= CTX_data_main(C); Scene *sce; + + if(!bmain) + return; /* frees all editmode undos */ undo_editmode_clear(); ED_undo_paint_free(); - for(sce=G.main->scene.first; sce; sce= sce->id.next) { + for(sce=bmain->scene.first; sce; sce= sce->id.next) { if(sce->obedit) { Object *ob= sce->obedit; |