diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-06-19 17:59:07 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-06-19 17:59:07 +0300 |
commit | c85a58abd5e723584e4bb37a62b56b86428516cd (patch) | |
tree | 85cb329edad286fd796f305d6786384682f53144 | |
parent | 6920d4c09f2b876c71642054938e6af427e3fda7 (diff) |
Blender 2.75: Fix compilation error caused by the addons fixv2.75-rc2
It was relying on a new function introduced by in 958c208.
-rw-r--r-- | source/blender/python/BPY_extern.h | 1 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h index a5cf0b94c62..815beebb159 100644 --- a/source/blender/python/BPY_extern.h +++ b/source/blender/python/BPY_extern.h @@ -86,6 +86,7 @@ void BPY_driver_reset(void); float BPY_driver_exec(struct ChannelDriver *driver, const float evaltime); int BPY_button_exec(struct bContext *C, const char *expr, double *value, const bool verbose); +int BPY_string_exec_ex(struct bContext *C, const char *expr, bool use_eval); int BPY_string_exec(struct bContext *C, const char *expr); void BPY_DECREF(void *pyob_ptr); /* Py_DECREF() */ diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 4be63042c1e..2c893c37bd6 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -607,7 +607,7 @@ int BPY_button_exec(bContext *C, const char *expr, double *value, const bool ver return error_ret; } -int BPY_string_exec(bContext *C, const char *expr) +int BPY_string_exec_ex(bContext *C, const char *expr, bool use_eval) { PyGILState_STATE gilstate; PyObject *main_mod = NULL; @@ -630,7 +630,7 @@ int BPY_string_exec(bContext *C, const char *expr) bmain_back = bpy_import_main_get(); bpy_import_main_set(CTX_data_main(C)); - retval = PyRun_String(expr, Py_eval_input, py_dict, py_dict); + retval = PyRun_String(expr, use_eval ? Py_eval_input : Py_file_input, py_dict, py_dict); bpy_import_main_set(bmain_back); @@ -650,6 +650,10 @@ int BPY_string_exec(bContext *C, const char *expr) return error_ret; } +int BPY_string_exec(bContext *C, const char *expr) +{ + return BPY_string_exec_ex(C, expr, true); +} void BPY_modules_load_user(bContext *C) { |