From 0ffc603553bb6a5dd3ce96e88bc9be34356fc0cf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 31 Dec 2015 21:15:29 +1100 Subject: Cleanup: Py API naming Use BPY_execute_* prefix for all Python execution commands --- source/blender/editors/interface/interface.c | 4 ++-- source/blender/editors/space_script/script_edit.c | 4 ++-- source/blender/editors/space_text/text_ops.c | 2 +- source/blender/editors/util/numinput.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/editors') 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; } -- cgit v1.2.3