Depsgraph: Add relation from node tree to material it's coming from

This commit is contained in:
Sergey Sharybin
2017-01-26 16:49:24 +01:00
parent 331f721725
commit c441eb27ea

View File

@@ -1654,7 +1654,19 @@ void DepsgraphRelationBuilder::build_material(Material *ma)
build_texture_stack(ma->mtex);
/* material's nodetree */
build_nodetree(ma->nodetree);
if (ma->nodetree != NULL) {
build_nodetree(ma->nodetree);
OperationKey ntree_key(&ma->nodetree->id,
DEPSNODE_TYPE_PARAMETERS,
DEG_OPCODE_PLACEHOLDER,
"Parameters Eval");
OperationKey material_key(&ma->id,
DEPSNODE_TYPE_SHADING,
DEG_OPCODE_PLACEHOLDER,
"Material Update");
add_relation(ntree_key, material_key,
DEPSREL_TYPE_UPDATE, "Material's NTree");
}
}
/* Recursively build graph for texture */