- report python script errors to blender report system, or through operators reports (when using operator callbacks).
- when python operators fail to execute they were returning RUNNING_MODAL, now return CANCELLED now when an operator fails it gives an error popup as well as a message in the terminal.
This commit is contained in:
@@ -5244,6 +5244,20 @@ static int bpy_class_call(PointerRNA *ptr, FunctionRNA *func, ParameterList *par
|
||||
}
|
||||
|
||||
if(err != 0) {
|
||||
ReportList *reports;
|
||||
/* alert the user, else they wont know unless they see the console. */
|
||||
if (!is_static && ptr->data && RNA_struct_is_a(ptr->type, &RNA_Operator)) {
|
||||
wmOperator *op= ptr->data;
|
||||
reports= op->reports;
|
||||
}
|
||||
else {
|
||||
/* wont alert users but they can view in 'info' space */
|
||||
reports= CTX_wm_reports(C);
|
||||
}
|
||||
|
||||
BPy_errors_to_report(reports);
|
||||
|
||||
/* also print in the console for py */
|
||||
PyErr_Print();
|
||||
PyErr_Clear();
|
||||
}
|
||||
|
Reference in New Issue
Block a user