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 <ideasman42@gmail.com>2021-09-02 08:29:33 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-09-02 08:30:54 +0300
commit809b33b69a04fc37e1535697b667158ca80f6d60 (patch)
tree0880e471560b8b0f2a585870af324ef6c158c71e
parent0ccbf5069431aaa323ca9c7f09cb62a0ea35ae86 (diff)
Docs: improve the error when undo poll fails
Calling undo in from Python background-mode would raise an exception without any information about how to initialize undo.
-rw-r--r--source/blender/editors/undo/ed_undo.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c
index 3e0029156c1..84d5d3b9aae 100644
--- a/source/blender/editors/undo/ed_undo.c
+++ b/source/blender/editors/undo/ed_undo.c
@@ -574,7 +574,12 @@ static bool ed_undo_is_init_poll(bContext *C)
{
wmWindowManager *wm = CTX_wm_manager(C);
if (wm->undo_stack == NULL) {
- CTX_wm_operator_poll_msg_set(C, "Undo disabled at startup");
+ /* This message is intended for Python developers,
+ * it will be part of the exception when attempting to call undo in background mode. */
+ CTX_wm_operator_poll_msg_set(
+ C,
+ "Undo disabled at startup in background-mode. "
+ "Call `ed.undo_push()` to explicitly initialize the undo-system.");
return false;
}
return true;