Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/util/ed_util.c')
-rw-r--r--source/blender/editors/util/ed_util.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index 19bd18ade1f..0c9ce9648c7 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -43,6 +43,7 @@
#include "ED_armature.h"
#include "ED_mesh.h"
+#include "ED_object.h"
#include "ED_sculpt.h"
#include "ED_util.h"
@@ -50,6 +51,27 @@
/* ********* 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;
+
+ /* 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;
+
+ if(ob == obact)
+ ED_object_toggle_modes(C, mode);
+ }
+ }
+}
+
/* frees all editmode stuff */
void ED_editors_exit(bContext *C)
{