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:
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);