Fix reports printing twice when called from Python in background-mode
Calling operators in background-mode always printed with the assumption that output should never be hidden. However operators called from `bpy.ops` were also printing reports to the `stdout` (needed for the Python console and generally useful). Resolve by adding a flag to signal that the owner of the ReportList is responsible for printing to the `stdout`.
This commit is contained in:
@@ -289,7 +289,7 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
|
||||
reports = MEM_mallocN(sizeof(ReportList), "wmOperatorReportList");
|
||||
|
||||
/* Own so these don't move into global reports. */
|
||||
BKE_reports_init(reports, RPT_STORE | RPT_OP_HOLD);
|
||||
BKE_reports_init(reports, RPT_STORE | RPT_OP_HOLD | RPT_PRINT_HANDLED_BY_OWNER);
|
||||
|
||||
#ifdef BPY_RELEASE_GIL
|
||||
/* release GIL, since a thread could be started from an operator
|
||||
|
||||
Reference in New Issue
Block a user