diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-12-06 16:48:48 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-01-20 13:37:00 +0300 |
commit | 8a0e91366c691f302e9c7a4c7dc3cba88933ac56 (patch) | |
tree | ad1d6e177c2c2fcf7e5153132882c31eb17e9d96 | |
parent | 85c7ecce278b139faa05cb8fe02e256c19f22612 (diff) |
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..
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc index aedd00685b3..cb2f057a090 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder.cc @@ -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(); } |