Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-09-14 07:06:44 +0300
committerCampbell Barton <campbell@blender.org>2022-09-14 07:06:44 +0300
commitd26220d97ab13f39b791468728a6089500d22caa (patch)
tree9980107e8db0e8b91b44fdbc8678a3ee2d863cd1 /source/blender/python/intern/bpy_operator.c
parent7bd60d40efbfaa3a18d3cfee409a1a3d1fa6c11d (diff)
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`.
Diffstat (limited to 'source/blender/python/intern/bpy_operator.c')
-rw-r--r--source/blender/python/intern/bpy_operator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index 95879b02295..2db8c08cfd4 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -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