[Bf-blender-cvs] [9dfc81ccf10] master: Fix regression in 2cc5af9c553cfc00b7d4616445ad954597a92d94

Campbell Barton noreply at git.blender.org
Thu Mar 11 17:22:57 CET 2021


Commit: 9dfc81ccf10153385e8ff744ab2a9e2a25ce6606
Author: Campbell Barton
Date:   Fri Mar 12 02:58:02 2021 +1100
Branches: master
https://developer.blender.org/rB9dfc81ccf10153385e8ff744ab2a9e2a25ce6606

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.

===================================================================

M	source/blender/windowmanager/intern/wm_files.c

===================================================================

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



More information about the Bf-blender-cvs mailing list