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:
authorCampbell Barton <ideasman42@gmail.com>2010-01-10 23:01:13 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-10 23:01:13 +0300
commitb36a05bb7e794335e3415594c41d3986cdc815e8 (patch)
treef6a3e9f13a6941b764d01d0c6b1e40df8198c6ea /source/blender/windowmanager
parent0bd98195a1d67ce741145a39147cf8272708f5a2 (diff)
- fix for crash if drivers were used in the .B.blend
- fix for problem where proxy objects could enter editmode but not exit
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/WM_api.h2
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c15
2 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index d2b67142eb5..94cd6ed85a0 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -50,7 +50,7 @@ typedef struct wmJob wmJob;
/* general API */
void WM_setprefsize (int stax, int stay, int sizx, int sizy);
-void WM_init (struct bContext *C);
+void WM_init (struct bContext *C, int argc, char **argv);
void WM_exit (struct bContext *C);
void WM_main (struct bContext *C);
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 6997bcaf309..a83b6c3609a 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -106,9 +106,9 @@ static void wm_free_reports(bContext *C)
/* only called once, for startup */
-void WM_init(bContext *C)
+void WM_init(bContext *C, int argc, char **argv)
{
-
+
if (!G.background) {
wm_ghost_init(C); /* note: it assigns C to ghost! */
wm_init_cursor_data();
@@ -129,9 +129,18 @@ void WM_init(bContext *C)
init_builtin_keyingsets(); /* editors/animation/keyframing.c */
+ /* python needs initializing before loading the .B.blend
+ * because it may contain PyDrivers. It also needs to be after
+ * initializing space types and other internal data */
+#ifndef DISABLE_PYTHON
+ BPY_set_context(C); /* necessary evil */
+ BPY_start_python(argc, argv);
+ BPY_load_user_modules(C);
+#endif
+
/* get the default database, plus a wm */
WM_read_homefile(C, NULL);
-
+
wm_init_reports(C); /* reports cant be initialized before the wm */
if (!G.background) {