Page MenuHome

Fix T66913: undo after frame-change doesn't refresh properly
ClosedPublic

Authored by Campbell Barton (campbellbarton) on Jan 28 2022, 5:22 AM.

Details

Summary

Use the ID.recalc flag to detect when updates after frame-change is needed.
Since comparing the last calculated frame doesn't take undo into account (see code-comment for details).

ID_RECALC_AUDIO_SEEK has been renamed to ID_RECALC_FRAME_CHANGE since this is not only related to audio however internally this flag is still categorized in NodeType::AUDIO.


This fixes T66913 & T95246.

Note that this could go via the more conventional checks for ID.recalc in the depsgraph,
making it closer to ID_RECALC_TIME which was removed in rB263148dbacc4.

Diff Detail

Repository
rB Blender
Branch
TEMP-DEPSGRAPH-FRAME-CHANGE (branched from master)
Build Status
Buildable 20313
Build 20313: arc lint + arc unit

Event Timeline

Campbell Barton (campbellbarton) requested review of this revision.Jan 28 2022, 5:22 AM
Campbell Barton (campbellbarton) created this revision.
  • Improve comment wording.

From what I can tell, the change seems reasonable. I just find it a bit weird to use ID_RECALC_AUDIO_SEEK. That could be quite confusing when debugging related issues. The other way around might make more sense if we really want to use the same flag for both.

Sergey Sharybin (sergey) requested changes to this revision.Jan 31 2022, 12:58 PM

Checking recalc flags prior time tagging seems a right solution to me.

The way how the new recalc flag is introduced I find hard to understand semantically.
The recalc flags are supposed to correspond to which part of ID did change. Exposing ID_RECALC_FRAME_CHANGE which is the same as ID_RECALC_AUDIO_SEEK is not clear to me. If you want to go a pseudonym route move it down under the Aggregate flags, use only for checks on runtime. section and rename to ID_RECALC_TIME_ALL. Alternatively rename the ID_RECALC_AUDIO_SEEK to ID_RECALC_FRAME_CHANGE. The latter one might be more clear for understanding.

This revision now requires changes to proceed.Jan 31 2022, 12:58 PM
  • Rename ID_RECALC_AUDIO_SEEK to ID_RECALC_FRAME_CHANGE
  • Move explanation for checking the flag into DEG_evaluate_on_refresh.
  • Missed rename of string identifier when renaming AUDIO_SEEK -> FRAME_CHANGE
Campbell Barton (campbellbarton) edited the summary of this revision. (Show Details)
  • Remove unnecessary parens.

From code side seems good.
Assuming you've tested undo of unkeyed animation changes and it works ;)

This revision is now accepted and ready to land.Feb 3 2022, 9:21 AM