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:
authorCampbell Barton <campbell@blender.org>2022-02-03 13:32:50 +0300
committerCampbell Barton <campbell@blender.org>2022-02-03 13:37:42 +0300
commit35aedd87e78d44aa0a622d26261ecac7ece12925 (patch)
tree20c3925988d25ea027f4c5b039e0b4ba547ac3f9 /source/blender/depsgraph
parent98cc3c6009ad0267c4f7b7da7e8725613cb32d31 (diff)
Fix T66913: undo after frame-change doesn't refresh properly
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`. Reviewed By: sergey Ref D13942
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_eval.cc8
-rw-r--r--source/blender/depsgraph/intern/depsgraph_tag.cc6
2 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc
index 7952f27507f..ae94fbcfdb8 100644
--- a/source/blender/depsgraph/intern/depsgraph_eval.cc
+++ b/source/blender/depsgraph/intern/depsgraph_eval.cc
@@ -72,6 +72,14 @@ void DEG_evaluate_on_refresh(Depsgraph *graph)
deg_graph->frame = frame;
deg_graph->ctime = ctime;
}
+ else if (scene->id.recalc & ID_RECALC_FRAME_CHANGE) {
+ /* Comparing depsgraph & scene frame fails in the case of undo,
+ * since the undo state is stored before updates from the frame change have been applied.
+ * In this case reading back the undo state will behave as if no updates on frame change
+ * is needed as the #Depsgraph.ctime & frame will match the values in the input scene.
+ * Use #ID_RECALC_FRAME_CHANGE to detect that recalculation is necessary. see: T66913. */
+ deg_graph->tag_time_source();
+ }
deg_flush_updates_and_refresh(deg_graph);
}
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 6614509f860..11074b5bf72 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -211,7 +211,7 @@ void depsgraph_tag_to_component_opcode(const ID *id,
case ID_RECALC_SEQUENCER_STRIPS:
*component_type = NodeType::SEQUENCER;
break;
- case ID_RECALC_AUDIO_SEEK:
+ case ID_RECALC_FRAME_CHANGE:
case ID_RECALC_AUDIO_FPS:
case ID_RECALC_AUDIO_VOLUME:
case ID_RECALC_AUDIO_MUTE:
@@ -737,8 +737,8 @@ const char *DEG_update_tag_as_string(IDRecalcFlag flag)
return "EDITORS";
case ID_RECALC_SEQUENCER_STRIPS:
return "SEQUENCER_STRIPS";
- case ID_RECALC_AUDIO_SEEK:
- return "AUDIO_SEEK";
+ case ID_RECALC_FRAME_CHANGE:
+ return "FRAME_CHANGE";
case ID_RECALC_AUDIO_FPS:
return "AUDIO_FPS";
case ID_RECALC_AUDIO_VOLUME: