PyDoc: bpy.types.Operator docs - add note on execution context

Clarify the default behavior when invoke and execute is called.

Ref: !135854
This commit is contained in:
Andrej730
2025-03-26 16:51:40 +11:00
committed by Campbell Barton
parent 224b8bb116
commit ad5494d7ac
4 changed files with 19 additions and 2 deletions

View File

@@ -14,6 +14,10 @@ Common return values are ``{'FINISHED'}`` and ``{'CANCELLED'}``, the latter
meaning that the operator execution was aborted without making any changes or
saving an undo history entry.
If operator was cancelled but there wasn't any reports from it with ``{'ERROR'}`` type,
it will just return ``{'CANCELLED'}`` without raising any exceptions.
If it had error reports, then it will raise a ``RuntimeError`` including all report messages.
Calling an operator in the wrong context will raise a ``RuntimeError``,
there is a poll() method to avoid this problem.