Depsgraph: Fix assert failure on Cycles render

Was happening when there was material in bmain but not used by any object.
This commit is contained in:
Sergey Sharybin 2017-07-19 15:05:49 +02:00
parent 17dcdbcf16
commit 6bb7a4cdf2
1 changed files with 10 additions and 2 deletions

View File

@ -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 ********************* */