diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-07-19 16:05:49 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-07-19 16:20:07 +0300 |
commit | 6bb7a4cdf2f3415292ae397b2519141a2298b923 (patch) | |
tree | 2bbedf7a5c346296646d344fb0ba9316e5a4a3d5 /source | |
parent | 17dcdbcf1647f9ea816d3e39f866d4943c02e0a9 (diff) |
Depsgraph: Fix assert failure on Cycles render
Was happening when there was material in bmain but not used by any object.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_query.cc | 12 |
1 files changed, 10 insertions, 2 deletions
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 ********************* */ |