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:
authorCampbell Barton <ideasman42@gmail.com>2015-12-31 13:15:29 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-12-31 13:20:41 +0300
commit0ffc603553bb6a5dd3ce96e88bc9be34356fc0cf (patch)
tree1415890bf433ac933fee88fb80e37c322e26e281 /source/blender/editors
parent16e1bbf1dbbefde14533b0de5b68ae3ac269e05c (diff)
Cleanup: Py API naming
Use BPY_execute_* prefix for all Python execution commands
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface.c4
-rw-r--r--source/blender/editors/space_script/script_edit.c4
-rw-r--r--source/blender/editors/space_text/text_ops.c2
-rw-r--r--source/blender/editors/util/numinput.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 79a7f4fc57a..95187bbd005 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -2272,7 +2272,7 @@ static bool ui_set_but_string_eval_num_unit(bContext *C, uiBut *but, const char
bUnit_ReplaceString(str_unit_convert, sizeof(str_unit_convert), but->drawstr,
ui_get_but_scale_unit(but, 1.0), but->block->unit->system, RNA_SUBTYPE_UNIT_VALUE(unit_type));
- return (BPY_button_exec(C, str_unit_convert, value, true) != -1);
+ return BPY_execute_string_as_number(C, str_unit_convert, value, true);
}
#endif /* WITH_PYTHON */
@@ -2287,7 +2287,7 @@ bool ui_but_string_set_eval_num(bContext *C, uiBut *but, const char *str, double
if (str[0] != '\0') {
bool is_unit_but = (ui_but_is_float(but) && ui_but_is_unit(but));
/* only enable verbose if we won't run again with units */
- if (BPY_button_exec(C, str, value, is_unit_but == false) != -1) {
+ if (BPY_execute_string_as_number(C, str, value, is_unit_but == false)) {
/* if the value parsed ok without unit conversion this button may still need a unit multiplier */
if (is_unit_but) {
char str_new[128];
diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c
index d265ae62db6..6bfb51d07c6 100644
--- a/source/blender/editors/space_script/script_edit.c
+++ b/source/blender/editors/space_script/script_edit.c
@@ -59,7 +59,7 @@ static int run_pyfile_exec(bContext *C, wmOperator *op)
char path[512];
RNA_string_get(op->ptr, "filepath", path);
#ifdef WITH_PYTHON
- if (BPY_filepath_exec(C, path, op->reports)) {
+ if (BPY_execute_filepath(C, path, op->reports)) {
ARegion *ar = CTX_wm_region(C);
ED_region_tag_redraw(ar);
return OPERATOR_FINISHED;
@@ -125,7 +125,7 @@ static int script_reload_exec(bContext *C, wmOperator *op)
/* TODO, this crashes on netrender and keying sets, need to look into why
* disable for now unless running in debug mode */
WM_cursor_wait(1);
- BPY_string_exec(C, "__import__('bpy').utils.load_scripts(reload_scripts=True)");
+ BPY_execute_string(C, "__import__('bpy').utils.load_scripts(reload_scripts=True)");
WM_cursor_wait(0);
WM_event_add_notifier(C, NC_WINDOW, NULL);
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 948293d150b..4ded3e9be0d 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -598,7 +598,7 @@ static int text_run_script(bContext *C, ReportList *reports)
void *curl_prev = text->curl;
int curc_prev = text->curc;
- if (BPY_text_exec(C, text, reports, !is_live)) {
+ if (BPY_execute_text(C, text, reports, !is_live)) {
if (is_live) {
/* for nice live updates */
WM_event_add_notifier(C, NC_WINDOW | NA_EDITED, NULL);
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index d2bc8bc80c0..9bb4e050ae6 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -496,7 +496,7 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
n->unit_sys, n->unit_type[idx]);
/* Note: with angles, we always get values as radians here... */
- if (BPY_button_exec(C, str_unit_convert, &val, false) != -1) {
+ if (BPY_execute_string_as_number(C, str_unit_convert, &val, false)) {
n->val[idx] = (float)val;
n->val_flag[idx] &= ~NUM_INVALID;
}