|
Blender V4.3
|
#include <Python.h>Go to the source code of this file.
Functions | |
| short | BPy_reports_to_error (struct ReportList *reports, PyObject *exception, bool clear) |
| void | BPy_reports_write_stdout (const struct ReportList *reports, const char *header) |
| bool | BPy_errors_to_report_ex (struct ReportList *reports, const char *error_prefix, bool use_full, bool use_location) |
| bool | BPy_errors_to_report (struct ReportList *reports) |
| struct bContext * | BPY_context_get (void) |
| void | bpy_context_set (struct bContext *C, PyGILState_STATE *gilstate) |
| void | bpy_context_clear (struct bContext *C, const PyGILState_STATE *gilstate) |
|
extern |
Context should be used but not now because it causes some bugs.
Definition at line 141 of file bpy_interface.cc.
References BLI_time_now_seconds(), BPY_context_set(), and py_call_level.
Referenced by bpy_class_call(), bpy_cli_command_exec(), BPY_modules_load_user(), bpy_msgbus_notify(), bpy_prop_enum_itemf_fn(), bpy_prop_string_visit_for_search_fn(), bpy_prop_update_fn(), BPY_run_string_as_intptr(), BPY_run_string_as_number(), BPY_run_string_as_string_and_len(), BPY_run_string_as_string_and_len_or_none(), bpy_run_string_impl(), cb_region_draw(), cb_wm_cursor_draw(), and python_script_exec().
| struct bContext * BPY_context_get | ( | void | ) |
Definition at line 241 of file bpy_interface.cc.
References bpy_context_module, PointerRNA::data, and BPy_StructRNA::ptr.
Referenced by bpy_atexit(), bpy_class_call(), bpy_gizmo_target_set_value(), bpy_lib_load(), bpy_msgbus_clear_by_owner(), bpy_msgbus_publish_rna(), bpy_msgbus_subscribe_rna(), BPY_python_end(), BPY_rna_operator_poll_message_set(), foreach_getset(), mathutils_rna_matrix_set(), mathutils_rna_vector_set(), mathutils_rna_vector_set_index(), pyop_as_string(), pyop_call(), pyop_poll(), pyrna_enum_as_string(), pyrna_enum_to_py(), pyrna_func_call(), pyrna_prop_array_ass_subscript(), pyrna_prop_to_enum_bitfield(), pyrna_prop_update(), pyrna_py_to_prop(), pyrna_py_to_prop_array_index(), pyrna_register_class(), pyrna_string_to_enum(), pyrna_struct_driver_add(), pyrna_struct_driver_remove(), pyrna_struct_keyframe_insert(), pyrna_struct_keyframe_parse(), and pyrna_unregister_class().
|
extern |
Definition at line 117 of file bpy_interface.cc.
References BLI_time_now_seconds(), BPY_context_update(), and py_call_level.
Referenced by bpy_class_call(), bpy_cli_command_exec(), BPY_modules_load_user(), bpy_msgbus_notify(), bpy_prop_enum_itemf_fn(), bpy_prop_string_visit_for_search_fn(), bpy_prop_update_fn(), BPY_run_string_as_intptr(), BPY_run_string_as_number(), BPY_run_string_as_string_and_len(), BPY_run_string_as_string_and_len_or_none(), bpy_run_string_impl(), cb_region_draw(), cb_wm_cursor_draw(), and python_script_exec().
| bool BPy_errors_to_report | ( | struct ReportList * | reports | ) |
| reports | Any errors will be added to the report list. |
stdout/stderr, so you may wish to call either BKE_reports_print(reports) or PyErr_Print() afterwards. Typically PyErr_Print() is preferable as sys.excepthook is called.Definition at line 137 of file bpy_capi_utils.cc.
References BPy_errors_to_report_ex().
Referenced by bpy_class_call(), bpy_run_string_impl(), and python_script_exec().
| bool BPy_errors_to_report_ex | ( | struct ReportList * | reports, |
| const char * | error_prefix, | ||
| bool | use_full, | ||
| bool | use_location ) |
Definition at line 68 of file bpy_capi_utils.cc.
References BKE_reportf(), BKE_reports_free(), BKE_reports_init(), BKE_reports_move_to_reports(), ReportList::flag, PyC_ExceptionBuffer(), PyC_ExceptionBuffer_Simple(), PyC_FileAndNum(), RPT_ERROR, RPT_PRINT_HANDLED_BY_OWNER, and ReportList::storelevel.
Referenced by BPy_errors_to_report().
| short BPy_reports_to_error | ( | struct ReportList * | reports, |
| PyObject * | exception, | ||
| bool | clear ) |
Error reporting: convert BKE_report (ReportList) reports into python errors.
| clear | When true, BKE_reports_free is called on the given reports, which should then be considered as 'freed' data and not used anymore. |
Definition at line 25 of file bpy_capi_utils.cc.
References BKE_reports_free(), BKE_reports_string(), clear(), MEM_freeN(), and RPT_ERROR.
Referenced by bpy_lib_enter(), bpy_lib_write(), pyop_call(), pyrna_func_call(), pyrna_py_to_prop(), pyrna_register_class(), pyrna_struct_driver_add(), pyrna_struct_driver_remove(), pyrna_struct_keyframe_delete(), and pyrna_struct_keyframe_insert().
| void BPy_reports_write_stdout | ( | const struct ReportList * | reports, |
| const char * | header ) |
A version of BKE_report_write_file_fp that uses Python's stdout.