diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-24 13:40:33 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-26 11:23:38 +0300 |
commit | 1693a5efe91999b60b3dc0bdff727473b3bd00bb (patch) | |
tree | 2283e6d5e661b7a26785c1d6fba28db505b93200 /source/blender/depsgraph/intern/depsgraph_tag.cc | |
parent | 250995d67b772f0b7bd80aabb79b18d278ffc257 (diff) |
Fix T66378: Missing animation update when switching view layer
Current frame is stored in a scene, and scene might have multiple view
layers. The inactive view layers were not informed about scene's frame
being changed, so when user switched back to view after changing scene
frame it was in an inconsistent state between current scene frame and
animation.
Now we tag scene for time changes, so dependency graph can catch up
and do proper update.
Currently tagging is from quite generic place. Probably better approach
would be to tag from where frame is actually being assigned. Downside
of this is that it's easy to miss some places.
Reviewers: brecht, mont29
Reviewed By: brecht
Maniphest Tasks: T66378
Differential Revision: https://developer.blender.org/D5332
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_tag.cc')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_tag.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 583191490d2..f9105b53536 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -229,6 +229,9 @@ void depsgraph_tag_to_component_opcode(const ID *id, case ID_RECALC_PARAMETERS: *component_type = NodeType::PARAMETERS; break; + case ID_RECALC_TIME: + BLI_assert(!"Should be handled outside of this function"); + break; case ID_RECALC_ALL: case ID_RECALC_PSYS_ALL: BLI_assert(!"Should not happen"); @@ -360,6 +363,12 @@ static void graph_id_tag_update_single_flag(Main *bmain, } return; } + else if (tag == ID_RECALC_TIME) { + if (graph != NULL) { + graph->need_update_time = true; + } + return; + } /* Get description of what is to be tagged. */ NodeType component_type; OperationCode operation_code; @@ -664,6 +673,8 @@ const char *DEG_update_tag_as_string(IDRecalcFlag flag) return "AUDIO"; case ID_RECALC_PARAMETERS: return "PARAMETERS"; + case ID_RECALC_TIME: + return "TIME"; case ID_RECALC_ALL: return "ALL"; } |