diff options
author | Bastien Montagne <bastien@blender.org> | 2020-11-12 12:41:33 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-11-12 12:47:50 +0300 |
commit | bc090387ace9cf041455fa01e68d61551c47e18f (patch) | |
tree | 20aa9a855f24aefd1d2a43bff476e15669a0d4c8 /source/blender/editors/sculpt_paint/paint_mask.c | |
parent | fb4113defb46cf7ae0409336a714eb1a79cd6817 (diff) |
Fix T82388: Sculpt mode: Unexpected undo behavior.
Issue exposed by rB4c7b1766a7f1.
Main idea is that non-memfile first undo step should check into previous
memfile and tag the ID it is editing as `future_changed`.
That way, when we go back and undo to the memfile, said IDs are properly
detected as changed and re-read from the memfile.
Otherwise, undo system sees them as unchanged, and just re-use the
current data instead.
Note that currently only Sculpt mode seems affected (probably because it
is storing the mode switch itself as a Sculpt undo step instead of a
memfile one), but similar action might be needed in some other cases
too.
Maniphest Tasks: T82388
Differential Revision: https://developer.blender.org/D9510
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_mask.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_mask.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c index ad7b29ae33a..4dd7ecb09ca 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.c +++ b/source/blender/editors/sculpt_paint/paint_mask.c @@ -169,7 +169,7 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op) BKE_pbvh_search_gather(pbvh, NULL, NULL, &nodes, &totnode); - SCULPT_undo_push_begin("Mask flood fill"); + SCULPT_undo_push_begin(ob, "Mask flood fill"); MaskTaskData data = { .ob = ob, @@ -707,7 +707,7 @@ static bool sculpt_gesture_is_vertex_effected(SculptGestureContext *sgcontext, P static void sculpt_gesture_apply(bContext *C, SculptGestureContext *sgcontext) { SculptGestureOperation *operation = sgcontext->operation; - SCULPT_undo_push_begin("Sculpt Gesture Apply"); + SCULPT_undo_push_begin(CTX_data_active_object(C), "Sculpt Gesture Apply"); operation->sculpt_gesture_begin(C, sgcontext); |