[Bf-blender-cvs] [6bb7a4cdf2f] blender2.8: Depsgraph: Fix assert failure on Cycles render

Sergey Sharybin noreply at git.blender.org
Wed Jul 19 17:34:11 CEST 2017


Commit: 6bb7a4cdf2f3415292ae397b2519141a2298b923
Author: Sergey Sharybin
Date:   Wed Jul 19 15:05:49 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB6bb7a4cdf2f3415292ae397b2519141a2298b923

Depsgraph: Fix assert failure on Cycles render

Was happening when there was material in bmain but not used by any object.

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

M	source/blender/depsgraph/intern/depsgraph_query.cc

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

diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc
index 2ff423acc9c..4e0ab0f77a0 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -104,8 +104,16 @@ Object *DEG_get_evaluated_object(Depsgraph *depsgraph, Object *object)
 
 ID *DEG_get_evaluated_id(struct Depsgraph *depsgraph, ID *id)
 {
-	DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(depsgraph);
-	return deg_graph->get_cow_id(id);
+	/* TODO(sergey): This is a duplicate of Depsgraph::get_cow_id(),
+	 * but here we never do assert, since we don't know nature of the
+	 * incoming ID datablock.
+	 */
+	DEG::Depsgraph *deg_graph = (DEG::Depsgraph *)depsgraph;
+	DEG::IDDepsNode *id_node = deg_graph->find_id_node(id);
+	if (id_node == NULL) {
+		return id;
+	}
+	return id_node->id_cow;
 }
 
 /* ************************ DAG ITERATORS ********************* */




More information about the Bf-blender-cvs mailing list