diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-18 20:18:02 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-20 13:35:25 +0300 |
commit | 5e968a996a5397a14d00c49e67c74b993859a1d6 (patch) | |
tree | 3ba545b2085c16e5ed33ce868003915f07e3454b /source/blender/depsgraph | |
parent | 0619f960c2999873ed2e9a24a1f5d77eac03e64d (diff) |
Objects: restore per object restrict view/render/select.
Note this is now separate from H key hiding, and meant for more persistent
ways to define which objects are relevant to the viewport or render.
This avoids some cases where you'd have to create collection specifically
to hide objects for viewport/render.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 8 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index d4a115cfb8b..9b0c3354c47 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -458,6 +458,14 @@ void DepsgraphNodeBuilder::build_collection( add_id_node(&collection->id); /* Build collection objects. */ LISTBASE_FOREACH (CollectionObject *, cob, &collection->gobject) { + if (allow_restrict_flags) { + const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) + ? OB_RESTRICT_VIEW + : OB_RESTRICT_RENDER; + if (cob->ob->restrictflag & restrict_flag) { + continue; + } + } build_object(-1, cob->ob, DEG_ID_LINKED_INDIRECTLY); } /* Build child collections. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index a092902ee48..e728ae787c2 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -469,6 +469,12 @@ void DepsgraphRelationBuilder::build_collection( DEG_OPCODE_TRANSFORM_LOCAL); if (!group_done) { LISTBASE_FOREACH (CollectionObject *, cob, &collection->gobject) { + const int restrict_flag = (graph_->mode == DAG_EVAL_VIEWPORT) + ? OB_RESTRICT_VIEW + : OB_RESTRICT_RENDER; + if (cob->ob->restrictflag & restrict_flag) { + continue; + } build_object(NULL, cob->ob); } LISTBASE_FOREACH (CollectionChild *, child, &collection->children) { |