diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-05 05:08:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-05 05:08:54 +0300 |
commit | 96b646c68dd9f62f7655b7eee902bddb908e12a5 (patch) | |
tree | 9ccc70ed2f3cdb9aeb60f5dbacc4d798ffa8223f /source/creator | |
parent | 8200e44c392f999efa6660f9f81af25792752bd4 (diff) |
edits for BPY_extern.h functions, no functional changes
- remove unused code.
- BPY_run_python_script() split in 2, BPY_filepath_exec, BPY_text_exec
- renamed funcs.
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/creator/creator.c | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 78aa98cb7f5..8db4954d876 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -556,7 +556,7 @@ endif() ge_scenegraph ge_logic_network bf_gen_system - bf_python # duplicate for BPY_eval_driver + bf_python # duplicate for BPY_driver_exec ge_logic_ngnetwork extern_bullet ge_logic_loopbacknetwork diff --git a/source/creator/creator.c b/source/creator/creator.c index aaa96752cc3..92da0fe5beb 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -861,7 +861,7 @@ static int run_python(int argc, char **argv, void *data) BLI_strncpy(filename, argv[1], sizeof(filename)); BLI_path_cwd(filename); - BPY_CTX_SETUP( BPY_run_python_script(C, filename, NULL, NULL) ) + BPY_CTX_SETUP(BPY_filepath_exec(C, filename, NULL)) return 1; } else { @@ -878,10 +878,9 @@ static int run_python(int argc, char **argv, void *data) static int run_python_console(int UNUSED(argc), char **argv, void *data) { #ifdef WITH_PYTHON - bContext *C = data; - const char *expr= "__import__('code').interact()"; + bContext *C = data; - BPY_CTX_SETUP( BPY_eval_string(C, expr) ) + BPY_CTX_SETUP(BPY_string_exec(C, "__import__('code').interact()")) return 0; #else @@ -926,8 +925,8 @@ static int load_file(int UNUSED(argc), char **argv, void *data) /* WM_read_file() runs normally but since we're in background mode do here */ #ifdef WITH_PYTHON /* run any texts that were loaded in and flagged as modules */ - BPY_reset_driver(); - BPY_load_user_modules(C); + BPY_driver_reset(); + BPY_modules_load_user(C); #endif /* happens for the UI on file reading too (huh? (ton))*/ @@ -1159,7 +1158,7 @@ int main(int argc, char **argv) * NOTE: the U.pythondir string is NULL until WM_init() is executed, * so we provide the BPY_ function below to append the user defined * pythondir to Python's sys.path at this point. Simply putting - * WM_init() before BPY_start_python() crashes Blender at startup. + * WM_init() before BPY_python_start() crashes Blender at startup. * Update: now this function also inits the bpymenus, which also depend * on U.pythondir. */ |