diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-31 11:34:01 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-31 11:37:13 +0300 |
commit | fcfe1963a622fed257b8b9597424bf11edb19c52 (patch) | |
tree | 2ea5b8dc3efa03ea8fbb42e2942a067fa5354292 /source/blender/depsgraph/intern | |
parent | 5cbad89637c0f3c28b2d4896ca3d8b03542d507e (diff) |
Fix depsgraph copying and evaluating hidden objects.
Diffstat (limited to 'source/blender/depsgraph/intern')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc | 8 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc | 6 |
2 files changed, 11 insertions, 3 deletions
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 a396aecd3a8..35f01c19608 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 @@ -102,10 +102,14 @@ void DepsgraphNodeBuilder::build_view_layer( * tricks here iterating over the view layer. */ int base_index = 0; + const int base_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ? + BASE_VISIBLE_VIEWPORT : BASE_VISIBLE_RENDER; LISTBASE_FOREACH(Base *, base, &view_layer->object_bases) { /* object itself */ - build_object(base_index, base->object, linked_state); - base->object->select_color = select_color++; + if (base->flag & base_flag) { + build_object(base_index, base->object, linked_state); + base->object->select_color = select_color++; + } ++base_index; } build_layer_collections(&view_layer->layer_collections); 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 f575be9f659..4db72a349dc 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 @@ -86,8 +86,12 @@ void DepsgraphRelationBuilder::build_view_layer(Scene *scene, ViewLayer *view_la * passed to the evaluation functions. During relations builder we only * do NULL-pointer check of the base, so it's fine to pass original one. */ + const int base_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ? + BASE_VISIBLE_VIEWPORT : BASE_VISIBLE_RENDER; LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) { - build_object(base, base->object); + if (base->flag & base_flag) { + build_object(base, base->object); + } } build_layer_collections(&view_layer->layer_collections); |