Docs: formalize naming for generic callbacks in BKE_callbacks.h

Add a doc-string explaining the purpose of each call back and
how they should be used.

Also add a currently unused callback 'POST_FAIL' that is to be used in
cases the action fails - giving script authors, a guarantee that a
call to `pre` will always have a matching `post/post_fail` call.

- D11422: adds a callback that can use 'post_fail'.
- T88696: proposed these conventions.
This commit is contained in:
Campbell Barton
2021-06-02 17:15:05 +10:00
parent 3b3742c75f
commit 507c19c0f7
2 changed files with 57 additions and 5 deletions

View File

@@ -43,6 +43,9 @@ void bpy_app_generic_callback(struct Main *main,
static PyTypeObject BlenderAppCbType;
/**
* See `BKE_callbacks.h` #eCbEvent declaration for the policy on naming.
*/
static PyStructSequence_Field app_cb_info_fields[] = {
{"frame_change_pre",
"Called after frame change for playback and rendering, before any data is evaluated for the "