Merged changes in the trunk up to revision 34193.
[blender.git] / source / creator / creator.c
index a83cfc62e142b854bfd0270316f746530689a230..7d78bb1e439adb5baf159c67cb50884f64b21c07 100644 (file)
@@ -58,6 +58,7 @@
 #include "BLI_args.h"
 #include "BLI_threads.h"
 #include "BLI_scanfill.h" // for BLI_setErrorCallBack, TODO, move elsewhere
+#include "BLI_utildefines.h"
 
 #include "DNA_ID.h"
 #include "DNA_scene_types.h"
@@ -863,7 +864,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 {
@@ -880,10 +881,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
@@ -907,7 +907,7 @@ static int load_file(int UNUSED(argc), char **argv, void *data)
 
                /*we successfully loaded a blend file, get sure that
                pointcache works */
-               if (retval!=0) {
+               if (retval != BKE_READ_FILE_FAIL) {
                        wmWindowManager *wm= CTX_wm_manager(C);
 
                        /* special case, 2.4x files */
@@ -928,8 +928,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))*/
@@ -1161,7 +1161,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.
         */