Blender  V3.3
Functions
bpy_capi_utils.h File Reference

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 bContextBPY_context_get (void)
 
void bpy_context_set (struct bContext *C, PyGILState_STATE *gilstate)
 
void bpy_context_clear (struct bContext *C, const PyGILState_STATE *gilstate)
 

Function Documentation

◆ bpy_context_clear()

void bpy_context_clear ( struct bContext C,
const PyGILState_STATE *  gilstate 
)

◆ BPY_context_get()

struct bContext* BPY_context_get ( void  )

◆ bpy_context_set()

void bpy_context_set ( struct bContext C,
PyGILState_STATE *  gilstate 
)

◆ BPy_errors_to_report()

bool BPy_errors_to_report ( struct ReportList reports)
Parameters
reportsWhen set, an error will be added to this report, when NULL, print the error.
Note
Unless the caller handles printing the reports (or reports is NULL) it's best to ensure the output is printed to the stdout/stderr:
if (!BKE_reports_print_test(reports)) {
}
bool BKE_reports_print_test(const ReportList *reports, eReportType type)
Definition: report.c:259
void BKE_reports_print(ReportList *reports, eReportType level)
Definition: report.c:267
bool BPy_errors_to_report(ReportList *reports)
The caller is responsible for clearing the error (see #PyErr_Clear).

Definition at line 113 of file bpy_capi_utils.c.

References BPy_errors_to_report_ex(), and NULL.

Referenced by bpy_class_call(), bpy_run_string_impl(), Freestyle::PythonInterpreter::interpretString(), and python_script_exec().

◆ BPy_errors_to_report_ex()

bool BPy_errors_to_report_ex ( struct ReportList reports,
const char *  error_prefix,
bool  use_full,
bool  use_location 
)

◆ BPy_reports_to_error()

short BPy_reports_to_error ( struct ReportList reports,
PyObject *  exception,
bool  clear 
)

◆ BPy_reports_write_stdout()

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.