diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-31 12:30:36 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-31 12:43:29 +0300 |
commit | 9948e26e14408a24000667d46bcd0bce99e437ce (patch) | |
tree | 07aec5e55d3b7aa62310a34de41f46cb702c6b4e /source/blender | |
parent | 1e6108e97246fe544e39d5a6d9fb907847fd907b (diff) |
Fix depsgrah copying and evaluating hidden collections.
Diffstat (limited to 'source/blender')
4 files changed, 33 insertions, 4 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index e4cdbdadee5..fbf94293236 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -424,6 +424,13 @@ void DepsgraphNodeBuilder::build_collection(Collection *collection) if (built_map_.checkIsBuiltAndTag(collection)) { return; } + + const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ? + COLLECTION_RESTRICT_VIEW : COLLECTION_RESTRICT_RENDER; + if (collection->flag & restrict_flag) { + return; + } + /* Build collection objects. */ LISTBASE_FOREACH (CollectionObject *, cob, &collection->gobject) { build_object(-1, cob->ob, DEG_ID_LINKED_INDIRECTLY); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc index 35f01c19608..fd4b975e53f 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc @@ -67,9 +67,17 @@ namespace DEG { void DepsgraphNodeBuilder::build_layer_collections(ListBase *lb) { + const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ? + COLLECTION_RESTRICT_VIEW : COLLECTION_RESTRICT_RENDER; + for (LayerCollection *lc = (LayerCollection *)lb->first; lc; lc = lc->next) { - build_collection(lc->collection); - build_layer_collections(&lc->layer_collections); + if (!(lc->collection->flag & restrict_flag)) { + if (!(lc->flag & LAYER_COLLECTION_EXCLUDE)) { + build_collection(lc->collection); + } + + build_layer_collections(&lc->layer_collections); + } } } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 64bdbe49dac..c4be03eee8c 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -427,6 +427,12 @@ void DepsgraphRelationBuilder::build_id(ID *id) void DepsgraphRelationBuilder::build_collection(Object *object, Collection *collection) { + const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ? + COLLECTION_RESTRICT_VIEW : COLLECTION_RESTRICT_RENDER; + if (collection->flag & restrict_flag) { + return; + } + const bool group_done = built_map_.checkIsBuiltAndTag(collection); OperationKey object_local_transform_key(object != NULL ? &object->id : NULL, DEG_NODE_TYPE_TRANSFORM, diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc index 4db72a349dc..0f159248ff4 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc @@ -71,9 +71,17 @@ namespace DEG { void DepsgraphRelationBuilder::build_layer_collections(ListBase *lb) { + const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ? + COLLECTION_RESTRICT_VIEW : COLLECTION_RESTRICT_RENDER; + for (LayerCollection *lc = (LayerCollection *)lb->first; lc; lc = lc->next) { - build_collection(NULL, lc->collection); - build_layer_collections(&lc->layer_collections); + if (!(lc->collection->flag & restrict_flag)) { + if (!(lc->flag & LAYER_COLLECTION_EXCLUDE)) { + build_collection(NULL, lc->collection); + } + + build_layer_collections(&lc->layer_collections); + } } } |