[Bf-blender-cvs] [5892efa8830] blender2.8: Depsgraph: Fix crash when visible update is called after tagging for updates

Sergey Sharybin noreply at git.blender.org
Wed Feb 7 11:24:20 CET 2018


Commit: 5892efa88304803faf6d816568d0a071b79147a3
Author: Sergey Sharybin
Date:   Wed Feb 7 11:18:54 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB5892efa88304803faf6d816568d0a071b79147a3

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!

===================================================================

M	source/blender/depsgraph/intern/depsgraph_build.cc
M	source/blender/depsgraph/intern/depsgraph_tag.cc

===================================================================

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);
+		}
 	}
 }



More information about the Bf-blender-cvs mailing list