Python API Docs: explain the CANCELLED return code of operators.

The effect of CANCELLED on the undo stack is quite obscure, and
mistakenly using it after doing some changes causes confusing
behavior. It's better to describe it explicitly in the docs.
This commit is contained in:
2022-12-26 14:42:01 +02:00
parent cb93433a56
commit 7be5ca63ae
3 changed files with 11 additions and 2 deletions

View File

@@ -10,8 +10,9 @@ Only keyword arguments can be used to pass operator properties.
Operators don't have return values as you might expect,
instead they return a set() which is made up of:
``{'RUNNING_MODAL', 'CANCELLED', 'FINISHED', 'PASS_THROUGH'}``.
Common return values are ``{'FINISHED'}`` and ``{'CANCELLED'}``.
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.
Calling an operator in the wrong context will raise a ``RuntimeError``,
there is a poll() method to avoid this problem.