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:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-06-05 19:31:04 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-06-06 10:58:09 +0300
commit2819b609339b907421dc25c00223950ccee381ab (patch)
treef2987e81d16d7772cdb1da404d7183fb69b4e810 /source/blender/depsgraph
parent0afa9d6ae650e10397b8e94e84ddd0fa764b7565 (diff)
Fix T63035: Undoing in pose mode destroys the entire pose
Respect do_time flag in on_visible_update, matching behavior of old dependency graph and avoids unwanted animation updates. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D5026
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/DEG_depsgraph.h2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_build.cc2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_tag.cc37
3 files changed, 21 insertions, 20 deletions
diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h
index c6a7cf9dcb7..bdcb4061096 100644
--- a/source/blender/depsgraph/DEG_depsgraph.h
+++ b/source/blender/depsgraph/DEG_depsgraph.h
@@ -106,7 +106,7 @@ void DEG_free_node_types(void);
/* Update Tagging -------------------------------- */
/* Update dependency graph when visible scenes/layers changes. */
-void DEG_graph_on_visible_update(struct Main *bmain, Depsgraph *depsgraph);
+void DEG_graph_on_visible_update(struct Main *bmain, Depsgraph *depsgraph, const bool do_time);
/* Update all dependency graphs when visible scenes/layers changes. */
void DEG_on_visible_update(struct Main *bmain, const bool do_time);
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc
index bfb0a2aade4..d20bb000724 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build.cc
@@ -237,7 +237,7 @@ static void graph_build_finalize_common(DEG::Depsgraph *deg_graph, Main *bmain)
deg_graph->scene_cow = (Scene *)deg_graph->get_cow_id(&deg_graph->scene->id);
/* Flush visibility layer and re-schedule nodes for update. */
DEG::deg_graph_build_finalize(bmain, deg_graph);
- DEG_graph_on_visible_update(bmain, reinterpret_cast<::Depsgraph *>(deg_graph));
+ DEG_graph_on_visible_update(bmain, reinterpret_cast<::Depsgraph *>(deg_graph), false);
#if 0
if (!DEG_debug_consistency_check(deg_graph)) {
printf("Consistency validation failed, ABORTING!\n");
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 9f48dd2b47e..c5743e77d9a 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -460,30 +460,31 @@ void deg_graph_node_tag_zero(Main *bmain,
deg_graph_id_tag_legacy_compat(bmain, graph, id, (IDRecalcFlag)0, update_source);
}
-void deg_graph_on_visible_update(Main *bmain, Depsgraph *graph)
+void deg_graph_on_visible_update(Main *bmain, Depsgraph *graph, const bool do_time)
{
+ /* NOTE: It is possible to have this function called with `do_time=false` first and later (prior
+ * to evaluation though) with `do_time=true`. This means early output checks should be aware of
+ * this. */
for (DEG::IDNode *id_node : graph->id_nodes) {
if (!id_node->visible_components_mask) {
/* ID has no components which affects anything visible.
* No need bother with it to tag or anything. */
continue;
}
- if (id_node->visible_components_mask == id_node->previously_visible_components_mask) {
- /* The ID was already visible and evaluated, all the subsequent
- * updates and tags are to be done explicitly. */
- continue;
- }
int flag = 0;
if (!DEG::deg_copy_on_write_is_expanded(id_node->id_cow)) {
flag |= ID_RECALC_COPY_ON_WRITE;
- /* TODO(sergey): Shouldn't be needed, but currently we are lackign
- * some flushing of evaluated data to the original one, which makes,
- * for example, files saved with the rest pose.
- * Need to solve those issues carefully, for until then we evaluate
- * animation for datablocks which appears in the graph for the first
- * time. */
- if (BKE_animdata_from_id(id_node->id_orig) != NULL) {
- flag |= ID_RECALC_ANIMATION;
+ if (do_time) {
+ if (BKE_animdata_from_id(id_node->id_orig) != NULL) {
+ flag |= ID_RECALC_ANIMATION;
+ }
+ }
+ }
+ else {
+ if (id_node->visible_components_mask == id_node->previously_visible_components_mask) {
+ /* The ID was already visible and evaluated, all the subsequent
+ * updates and tags are to be done explicitly. */
+ continue;
}
}
/* We only tag components which needs an update. Tagging everything is
@@ -726,19 +727,19 @@ void DEG_graph_flush_update(Main *bmain, Depsgraph *depsgraph)
}
/* Update dependency graph when visible scenes/layers changes. */
-void DEG_graph_on_visible_update(Main *bmain, Depsgraph *depsgraph)
+void DEG_graph_on_visible_update(Main *bmain, Depsgraph *depsgraph, const bool do_time)
{
DEG::Depsgraph *graph = (DEG::Depsgraph *)depsgraph;
- DEG::deg_graph_on_visible_update(bmain, graph);
+ DEG::deg_graph_on_visible_update(bmain, graph, do_time);
}
-void DEG_on_visible_update(Main *bmain, const bool UNUSED(do_time))
+void DEG_on_visible_update(Main *bmain, const bool do_time)
{
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
Depsgraph *depsgraph = (Depsgraph *)BKE_scene_get_depsgraph(scene, view_layer, false);
if (depsgraph != NULL) {
- DEG_graph_on_visible_update(bmain, depsgraph);
+ DEG_graph_on_visible_update(bmain, depsgraph, do_time);
}
}
}