diff options
-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); |