Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/python/intern/bpy_interface.c')
-rw-r--r--source/blender/python/intern/bpy_interface.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 9b685d5ba6e..7ca087e4993 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -588,7 +588,9 @@ void BPY_DECREF_RNA_INVALIDATE(void *pyob_ptr)
/**
* \return success
*/
-bool BPY_execute_string_as_number(bContext *C, const char *expr, const bool verbose, double *r_value)
+bool BPY_execute_string_as_number(
+ bContext *C, const char *imports[],
+ const char *expr, const bool verbose, double *r_value)
{
PyGILState_STATE gilstate;
bool ok = true;
@@ -604,7 +606,7 @@ bool BPY_execute_string_as_number(bContext *C, const char *expr, const bool verb
bpy_context_set(C, &gilstate);
- ok = PyC_RunString_AsNumber(expr, "<blender button>", r_value);
+ ok = PyC_RunString_AsNumber(imports, expr, "<expr as number>", r_value);
if (ok == false) {
if (verbose) {
@@ -623,7 +625,9 @@ bool BPY_execute_string_as_number(bContext *C, const char *expr, const bool verb
/**
* \return success
*/
-bool BPY_execute_string_as_string(bContext *C, const char *expr, const bool verbose, char **r_value)
+bool BPY_execute_string_as_string(
+ bContext *C, const char *imports[],
+ const char *expr, const bool verbose, char **r_value)
{
BLI_assert(r_value && expr);
PyGILState_STATE gilstate;
@@ -636,7 +640,7 @@ bool BPY_execute_string_as_string(bContext *C, const char *expr, const bool verb
bpy_context_set(C, &gilstate);
- ok = PyC_RunString_AsString(expr, "<blender button>", r_value);
+ ok = PyC_RunString_AsString(imports, expr, "<expr as str>", r_value);
if (ok == false) {
if (verbose) {
@@ -657,7 +661,9 @@ bool BPY_execute_string_as_string(bContext *C, const char *expr, const bool verb
*
* \return success
*/
-bool BPY_execute_string_as_intptr(bContext *C, const char *expr, const bool verbose, intptr_t *r_value)
+bool BPY_execute_string_as_intptr(
+ bContext *C, const char *imports[],
+ const char *expr, const bool verbose, intptr_t *r_value)
{
BLI_assert(r_value && expr);
PyGILState_STATE gilstate;
@@ -670,7 +676,7 @@ bool BPY_execute_string_as_intptr(bContext *C, const char *expr, const bool verb
bpy_context_set(C, &gilstate);
- ok = PyC_RunString_AsIntPtr(expr, "<blender button>", r_value);
+ ok = PyC_RunString_AsIntPtr(imports, expr, "<expr as intptr>", r_value);
if (ok == false) {
if (verbose) {