[Bf-blender-cvs] [c85a58a] blender-v2.75-release: Blender 2.75: Fix compilation error caused by the addons fix

Sergey Sharybin noreply at git.blender.org
Fri Jun 19 17:25:07 CEST 2015


Commit: c85a58abd5e723584e4bb37a62b56b86428516cd
Author: Sergey Sharybin
Date:   Fri Jun 19 16:59:07 2015 +0200
Branches: blender-v2.75-release
https://developer.blender.org/rBc85a58abd5e723584e4bb37a62b56b86428516cd

Blender 2.75: Fix compilation error caused by the addons fix

It was relying on a new function introduced by in 958c208.

===================================================================

M	source/blender/python/BPY_extern.h
M	source/blender/python/intern/bpy_interface.c

===================================================================

diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h
index a5cf0b9..815beeb 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 4be6304..2c893c3 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)
 {




More information about the Bf-blender-cvs mailing list