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>2018-02-07 13:18:54 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-02-07 13:21:16 +0300
commit5892efa88304803faf6d816568d0a071b79147a3 (patch)
treeac6a6bccd3aeb3ad7f9b968d352f350f37b3dc9b
parent60eef5c7ff0b5dc45f79a86dc25729500d84bfd2 (diff)
Depsgraph: Fix crash when visible update is called after tagging for updates
It is possible to have non-NULL scene in graph which was never built yet, this happens when ID is tagged for update for non-built graph. Was causing crash opening deg_anim_pose_bones. Reported by Mai in IRC, thanks!
-rw-r--r--source/blender/depsgraph/intern/depsgraph_build.cc2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_tag.cc8
2 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc
index 2a8d6de29b6..b9264a25277 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build.cc
@@ -215,7 +215,7 @@ void DEG_graph_build_from_view_layer(Depsgraph *graph,
* This now could happen for both visible scene is changed and extra
* dependency graph was created for render engine.
*/
- const bool need_on_visible_update = (deg_graph->scene == NULL);
+ const bool need_on_visible_update = (deg_graph->id_nodes.size() == 0);
/* 1) Generate all the nodes in the graph first */
DEG::DepsgraphNodeBuilder node_builder(bmain, deg_graph);
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 38f43f5720b..f9d76fb6002 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -437,8 +437,12 @@ void deg_graph_on_visible_update(Main *bmain, Depsgraph *graph)
scene_iter = scene_iter->set)
{
IDDepsNode *scene_id_node = graph->find_id_node(&scene_iter->id);
- BLI_assert(scene_id_node != NULL);
- scene_id_node->tag_update(graph);
+ if (scene_id_node != NULL) {
+ scene_id_node->tag_update(graph);
+ }
+ else {
+ BLI_assert(graph->need_update);
+ }
}
}