Depsgraph: Only re-schedule objects which are on visible layers

Otherwise it's possible to cause infinite update loop in Cycles viewport.

Gets a bit messy logic, need to revisit this..
This commit is contained in:
Sergey Sharybin 2016-12-06 14:48:48 +01:00
parent 1b9cae9d04
commit 0371ef16ee
1 changed files with 12 additions and 10 deletions

View File

@ -154,19 +154,21 @@ void deg_graph_build_finalize(Depsgraph *graph)
}
GHASH_FOREACH_END();
ID *id = id_node->id;
if ((id->tag & LIB_TAG_ID_RECALC_ALL) &&
(id->tag & LIB_TAG_DOIT))
{
id_node->tag_update(graph);
id->tag &= ~LIB_TAG_DOIT;
}
else if (GS(id->name) == ID_OB) {
Object *object = (Object *)id;
if (object->recalc & OB_RECALC_ALL) {
if ((id_node->layers & graph->layers) != 0) {
ID *id = id_node->id;
if ((id->tag & LIB_TAG_ID_RECALC_ALL) &&
(id->tag & LIB_TAG_DOIT))
{
id_node->tag_update(graph);
id->tag &= ~LIB_TAG_DOIT;
}
else if (GS(id->name) == ID_OB) {
Object *object = (Object *)id;
if (object->recalc & OB_RECALC_ALL) {
id_node->tag_update(graph);
id->tag &= ~LIB_TAG_DOIT;
}
}
}
id_node->finalize_build();
}