Issue with Undoing after using next/previous keyframe shortcut. #66913

Closed
opened 2019-07-14 12:24:52 +02:00 by Mostafa · 22 comments

System Information
Operating system: Windows10
Graphics card: NVIDIA GeForce GTX 1070

Blender Version
Broken: 2.80 Release Candidate
Worked: (optional)

Short description of error
Using shortcuts for jump to next/previous keyframes and undoing animation modifications.

Exact steps for others to reproduce the error
1-set up shortcuts for jump to keyframes and next/previous frames
2- make a simple animation 2 keyframes (simple translation)
3- back and forth between keyframes with the shortcuts
4- modify the second keyframe (rotate)
6- Undo
The object will snap to the previous keyframe position.


NOTE: #95246 (Undo bone rotation after previous frame/keyframe jump operators undoes frame jump as well (frame in UI is still the same though)) is a duplicate of this report but has a test file and steps which are easier to reproduce.

**System Information** Operating system: Windows10 Graphics card: NVIDIA GeForce GTX 1070 **Blender Version** Broken: 2.80 Release Candidate Worked: (optional) **Short description of error** Using shortcuts for jump to next/previous keyframes and undoing animation modifications. **Exact steps for others to reproduce the error** 1-set up shortcuts for jump to keyframes and next/previous frames 2- make a simple animation 2 keyframes (simple translation) 3- back and forth between keyframes with the shortcuts 4- modify the second keyframe (rotate) 6- Undo The object will snap to the previous keyframe position. ---- NOTE: #95246 (Undo bone rotation after previous frame/keyframe jump operators undoes frame jump as well (frame in UI is still the same though)) is a duplicate of this report but has a test file and steps which are easier to reproduce.
Author

Added subscriber: @MugenMancer

Added subscriber: @MugenMancer

#95434 was marked as duplicate of this issue

#95434 was marked as duplicate of this issue

#95246 was marked as duplicate of this issue

#95246 was marked as duplicate of this issue

#94504 was marked as duplicate of this issue

#94504 was marked as duplicate of this issue
Mostafa changed title from Undoing after using next/previous keyframe shortcut to Issue with Undoing after using next/previous keyframe shortcut. 2019-07-14 21:59:22 +02:00

Added subscriber: @AdamPreisler

Added subscriber: @AdamPreisler

I can confirm this, here is the test .blend file
Issue with Undoing after using nextprevious keyframe shortcut.blend

I can confirm this, here is the test .blend file [Issue with Undoing after using nextprevious keyframe shortcut.blend](https://archive.blender.org/developer/F7755148/Issue_with_Undoing_after_using_nextprevious_keyframe_shortcut.blend)
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Can confirm as well.

Can confirm as well.
Sybren A. Stüvel self-assigned this 2019-12-20 13:59:16 +01:00

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Hmm I can't see a difference in the undo stack with key navigation or mouse navigation to a certain frame. They all look like this:

Read blend: /home/sybren/workspace/blender-git/T66913-Issue_with_Undoing_after_using_nextprevious_keyframe_shortcut.blend
INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:275 BKE_undosys_stack_clear: steps=1
INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:221 undosys_step_free_and_unlink: addr=0x7fe96342ab08, name='Original', type='Global Undo'
INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:341 undosys_stack_push_main: 'Original'
INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:156 undosys_step_encode: addr=0x7fe943fce908, name='Original', type='Global Undo'
INFO (ed.undo): /home/sybren/workspace/blender-git/blender/source/blender/editors/undo/ed_undo.c:81 ED_undo_push: name='Frame Change'
INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:405 BKE_undosys_stack_limit_steps_and_memory: steps=31, memory_limit=0
INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:156 undosys_step_encode: addr=0x7fe92e80c708, name='Frame Change', type='Global Undo'
Undo 2 Steps (*: active, #=applied, M=memfile-active, S=skip)
[    ]   0 type='Global Undo', name='Original'
[* M ]   1 type='Global Undo', name='Frame Change'
INFO (ed.undo): /home/sybren/workspace/blender-git/blender/source/blender/editors/undo/ed_undo.c:81 ED_undo_push: name='Rotate'
INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:405 BKE_undosys_stack_limit_steps_and_memory: steps=31, memory_limit=0
INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:156 undosys_step_encode: addr=0x7fe92e54d088, name='Rotate', type='Global Undo'
Undo 3 Steps (*: active, #=applied, M=memfile-active, S=skip)
[    ]   0 type='Global Undo', name='Original'
[    ]   1 type='Global Undo', name='Frame Change'
[* M ]   2 type='Global Undo', name='Rotate'
INFO (ed.undo): /home/sybren/workspace/blender-git/blender/source/blender/editors/undo/ed_undo.c:119 ed_undo_step_impl: name='(null)', step=1, undo_index=-1
INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:673 BKE_undosys_step_undo_with_data_ex: addr=0x7fe92e80c708, name='Frame Change', type='Global Undo'
INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:181 undosys_step_decode: addr=0x7fe92e54d088, name='Rotate', type='Global Undo'
INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:181 undosys_step_decode: addr=0x7fe92e80c708, name='Frame Change', type='Global Undo'
Undo 3 Steps (*: active, #=applied, M=memfile-active, S=skip)
[ #  ]   0 type='Global Undo', name='Original'
[*#M ]   1 type='Global Undo', name='Frame Change'
[    ]   2 type='Global Undo', name='Rotate'

@ideasman42 can you shine some light on this?

Hmm I can't see a difference in the undo stack with key navigation or mouse navigation to a certain frame. They all look like this: ``` Read blend: /home/sybren/workspace/blender-git/T66913-Issue_with_Undoing_after_using_nextprevious_keyframe_shortcut.blend INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:275 BKE_undosys_stack_clear: steps=1 INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:221 undosys_step_free_and_unlink: addr=0x7fe96342ab08, name='Original', type='Global Undo' INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:341 undosys_stack_push_main: 'Original' INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:156 undosys_step_encode: addr=0x7fe943fce908, name='Original', type='Global Undo' INFO (ed.undo): /home/sybren/workspace/blender-git/blender/source/blender/editors/undo/ed_undo.c:81 ED_undo_push: name='Frame Change' INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:405 BKE_undosys_stack_limit_steps_and_memory: steps=31, memory_limit=0 INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:156 undosys_step_encode: addr=0x7fe92e80c708, name='Frame Change', type='Global Undo' Undo 2 Steps (*: active, #=applied, M=memfile-active, S=skip) [ ] 0 type='Global Undo', name='Original' [* M ] 1 type='Global Undo', name='Frame Change' INFO (ed.undo): /home/sybren/workspace/blender-git/blender/source/blender/editors/undo/ed_undo.c:81 ED_undo_push: name='Rotate' INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:405 BKE_undosys_stack_limit_steps_and_memory: steps=31, memory_limit=0 INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:156 undosys_step_encode: addr=0x7fe92e54d088, name='Rotate', type='Global Undo' Undo 3 Steps (*: active, #=applied, M=memfile-active, S=skip) [ ] 0 type='Global Undo', name='Original' [ ] 1 type='Global Undo', name='Frame Change' [* M ] 2 type='Global Undo', name='Rotate' INFO (ed.undo): /home/sybren/workspace/blender-git/blender/source/blender/editors/undo/ed_undo.c:119 ed_undo_step_impl: name='(null)', step=1, undo_index=-1 INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:673 BKE_undosys_step_undo_with_data_ex: addr=0x7fe92e80c708, name='Frame Change', type='Global Undo' INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:181 undosys_step_decode: addr=0x7fe92e54d088, name='Rotate', type='Global Undo' INFO (bke.undosys): /home/sybren/workspace/blender-git/blender/source/blender/blenkernel/intern/undo_system.c:181 undosys_step_decode: addr=0x7fe92e80c708, name='Frame Change', type='Global Undo' Undo 3 Steps (*: active, #=applied, M=memfile-active, S=skip) [ # ] 0 type='Global Undo', name='Original' [*#M ] 1 type='Global Undo', name='Frame Change' [ ] 2 type='Global Undo', name='Rotate' ``` @ideasman42 can you shine some light on this?
Sybren A. Stüvel was unassigned by Dalai Felinto 2019-12-23 16:33:45 +01:00

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren
Campbell Barton was assigned by Sybren A. Stüvel 2020-01-02 14:57:04 +01:00
Campbell Barton was unassigned by Sybren A. Stüvel 2020-02-24 16:39:44 +01:00
Bastien Montagne was assigned by Sybren A. Stüvel 2020-02-24 16:39:44 +01:00

Note that we do not want time (i.e. animation data) to be re-evaluated on undo steps. think issue here is, transform values of the object stored in undo steps memfile are then the orig ones (from read data, matching first keyframe I guess).

Not 100% sure how to actually fix this, but think this should wait for after undo-speedup refactor work anyway, as that one changes quite a lot and might make this kind of issues more easily fixable (by allowing a better control over depsgraph re-evaluation after undo step, we could ensure that time/animation is actually re-evaluated in some cases, and not others...).

Note that we do not want time (i.e. animation data) to be re-evaluated on undo steps. think issue here is, transform values of the object stored in undo steps memfile are then the orig ones (from read data, matching first keyframe I guess). Not 100% sure how to actually fix this, but think this should wait for after undo-speedup refactor work anyway, as that one changes quite a lot and might make this kind of issues more easily fixable (by allowing a better control over depsgraph re-evaluation after undo step, we could ensure that time/animation is actually re-evaluated in some cases, and not others...).

Added subscriber: @LucianoMunoz

Added subscriber: @LucianoMunoz

Hey now that the undo speedup is in, is there any chance we can look at this bug?
its very annoying for animation.
Thank you <3

Hey now that the undo speedup is in, is there any chance we can look at this bug? its very annoying for animation. Thank you <3

Recently looked into this problem (missed being CC's on this task originally).

The root cause of this issue is that the depsgraph is comparing the current frame with the previously evaluated frame to check if updating for new-frame should be done, see: DEG_evaluate_on_refresh.

This is a problem for frame-change since unlike transform (for example) the tags to recalculate transform are written into the Object ID's that are stored as part of the memfile undo step (before the recalc flags are handled).

For the frame change operator, the recalc flag set in the scene only updates seeking ID_RECALC_AUDIO_SEEK.

A workaround for this is to re-evaluate the frame-change before writing the undo data, I tried out a patch for this D13610 and while it works I'd prefer the depsgraph handle this since that seems cleaner and more in keeping with the depsgraph design.


I'd suggest to have a tag for recalculating on frame change that runs irrespective of the last frame used to update the depsgraph.
Frame change operations would set this tag, it can be used along side ID_RECALC_AUDIO_SEEK in most cases.

This way loading undo steps won't miss updating data for frame changes - without having to apply this logic for all undo steps, and without adding hacks to the event system.

Recently looked into this problem (missed being CC's on this task originally). The root cause of this issue is that the depsgraph is comparing the current frame with the previously evaluated frame to check if updating for new-frame should be done, see: `DEG_evaluate_on_refresh`. This is a problem for frame-change since unlike transform (for example) the tags to recalculate transform are written into the Object ID's that are stored as part of the memfile undo step (before the recalc flags are handled). For the frame change operator, the recalc flag set in the scene only updates seeking `ID_RECALC_AUDIO_SEEK`. A workaround for this is to re-evaluate the frame-change before writing the undo data, I tried out a patch for this [D13610](https://archive.blender.org/developer/D13610) and while it works I'd prefer the depsgraph handle this since that seems cleaner and more in keeping with the depsgraph design. ---- I'd suggest to have a tag for recalculating on frame change that runs irrespective of the last frame used to update the depsgraph. Frame change operations would set this tag, it can be used along side ID_RECALC_AUDIO_SEEK in most cases. This way loading undo steps won't miss updating data for frame changes - without having to apply this logic for all undo steps, and without adding hacks to the event system.
Member

Added subscribers: @AFoxInSpace, @PratikPB2123

Added subscribers: @AFoxInSpace, @PratikPB2123
Member

related (I think) commit: 263148dbac
(for some reason I cannot reproduce the issue reported here, but a related issue has been reported in #95246 -- and that one there is a regression introduced in 263148dbac ...)

related (I think) commit: 263148dbac (for some reason I cannot reproduce the issue reported here, but a related issue has been reported in #95246 -- and that one there is a regression introduced in 263148dbac ...)
Added subscribers: @Njesper, @JacquesLucke, @JakobBaldwin, @TKColding
Member

Will also raise prio again (can only assume this was set to low prio in order to wait for the undo speedup - which is in for a year now) since this is quite bad for animators.

Will also raise prio again (can only assume this was set to low prio in order to wait for the undo speedup - which is in for a year now) since this is quite bad for animators.
Member

Added subscriber: @Facu

Added subscriber: @Facu

This issue was referenced by 35aedd87e7

This issue was referenced by 35aedd87e78d44aa0a622d26261ecac7ece12925

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
10 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#66913
No description provided.