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-03-11 18:58:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-03-11 19:21:39 +0300
commit9dfc81ccf10153385e8ff744ab2a9e2a25ce6606 (patch)
tree1d1c25b40dc78ccca71ed854073d11e75839a6b3 /source/blender/windowmanager/intern/wm_files.c
parent350ad4bcb1b38ed07f5198a7340ebbe9ab856bf3 (diff)
Fix regression in 2cc5af9c553cfc00b7d4616445ad954597a92d94
The check for undo-depth increment/decrement assumed a newly loaded window manager would have a different pointer. This broke bl_animation_fcurves test indirectly, the change to undo-depth caused the redo panel to attempt to popup in background mode - which isn't supported. Now the pointer is unchanged, the undo-depth is assumed to match the value used when calling the operator. The undo-depth is now properly maintained between file loads, which is an improvement on the original behavior which reset it.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index bd220e2ff95..8357dfd7417 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -311,6 +311,10 @@ static void wm_window_match_replace_by_file_wm(bContext *C,
BLI_assert(bmain->relations == NULL);
BKE_libblock_remap(bmain, wm, oldwm, ID_REMAP_SKIP_INDIRECT_USAGE | ID_REMAP_SKIP_USER_CLEAR);
+ /* Maintain the undo-depth between file loads. Useful so Python can perform
+ * nested operator calls that exit with the proper undo-depth. */
+ wm->op_undo_depth = oldwm->op_undo_depth;
+
/* Simple pointer swapping step. */
BLI_remlink(current_wm_list, oldwm);
BLI_remlink(readfile_wm_list, wm);