diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-13 12:28:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-13 12:28:05 +0300 |
commit | 4c7dc3e5c5423ec20ca69841e49718fbae02a22d (patch) | |
tree | 0b3cb4e7d642c40d2ce5cc8f5cf941cc08d4af44 /source/creator | |
parent | d0dff582a88da396234fc913f8ed35f275d6c34d (diff) |
changes python initialization
- bpy is now a python package, this makes it easier to add utility modules and adjust python startup which was previously using verbose Py/C api. Access should not be any slower since both C and Python modules use dictionary access.
- loop over scripts and load via python (currently F8 reload isnt working, will add back shortly)
- the C module is kept but renamed to _bpy and not meant for direct access from anything but the bpy package.
- bpy_types.py is an exception since it runs before the bpy package is initialized.
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/creator.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c index b4c962cbfc8..6535f578cc1 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -489,11 +489,12 @@ int main(int argc, char **argv) } } -#ifndef DISABLE_PYTHON - BPY_start_python(argc, argv); -#endif - WM_init(C); + +#ifndef DISABLE_PYTHON + BPY_set_context(C); /* necessary evil */ + BPY_start_python(argc, argv); +#endif // XXX BRECHT SOLVE BLI_where_is_temp( btempdir, 1 ); /* call after loading the .B.blend so we can read U.tempdir */ @@ -530,6 +531,7 @@ int main(int argc, char **argv) WM_init(C); #ifndef DISABLE_PYTHON + BPY_set_context(C); /* necessary evil */ BPY_start_python(argc, argv); #endif BLI_where_is_temp( btempdir, 0 ); /* call after loading the .B.blend so we can read U.tempdir */ @@ -543,13 +545,13 @@ int main(int argc, char **argv) * Update: now this function also inits the bpymenus, which also depend * on U.pythondir. */ - BPY_post_start_python(); + + // TODO - U.pythondir - BPY_run_ui_scripts(C, 0); /* dont need to reload the first time */ #endif CTX_py_init_set(C, 1); - WM_keymap_init(C); /* after BPY_run_ui_scripts() */ + WM_keymap_init(C); #ifdef WITH_QUICKTIME |