diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-08 20:26:46 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-12 23:36:43 +0300 |
commit | 77879ac038e3576eeeeb651ce78706cb95399098 (patch) | |
tree | e3816728abb2e98b92c4c639f356afba0a8dd3b6 /source/blender/depsgraph | |
parent | 6700c02e53ed02fbabc36cd6763f65f74e2ab304 (diff) |
Fix T55376: instanced collection render visibility ignored.
For physics simulation it's still fuzzy though, but this needs bigger
design for how it works with view layers and visibility.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 9 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 28 |
2 files changed, 16 insertions, 21 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index d67f702ba85..4ea2840648f 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -897,11 +897,9 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene) /* objects - simulation participants */ if (rbw->group) { - const ListBase group_objects = BKE_collection_object_cache_get(rbw->group); - LISTBASE_FOREACH (Base *, base, &group_objects) { - Object *object = base->object; - - if (!object || (object->type != OB_MESH)) + FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(rbw->group, object) + { + if (object->type != OB_MESH) continue; /* 2) create operation for flushing results */ @@ -915,6 +913,7 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene) get_cow_datablock(object)), DEG_OPCODE_RIGIDBODY_TRANSFORM_COPY); } + FOREACH_COLLECTION_OBJECT_RECURSIVE_END; } } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index eb1ee0c1535..f1eb637e9eb 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -478,16 +478,12 @@ void DepsgraphRelationBuilder::build_collection( } } if (object != NULL) { - const ListBase group_objects = BKE_collection_object_cache_get(collection); - const int base_flag = (graph_->mode == DAG_EVAL_VIEWPORT) ? - BASE_VISIBLE_VIEWPORT : BASE_VISIBLE_RENDER; - LISTBASE_FOREACH (Base *, base, &group_objects) { - if ((base->flag & base_flag) == 0) { - continue; - } - ComponentKey dupli_transform_key(&base->object->id, DEG_NODE_TYPE_TRANSFORM); + FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN(collection, ob, graph_->mode) + { + ComponentKey dupli_transform_key(&ob->id, DEG_NODE_TYPE_TRANSFORM); add_relation(dupli_transform_key, object_local_transform_key, "Dupligroup"); } + FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_END; } } @@ -1430,10 +1426,9 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) /* objects - simulation participants */ if (rbw->group) { - const ListBase group_objects = BKE_collection_object_cache_get(rbw->group); - LISTBASE_FOREACH (Base *, base, &group_objects) { - Object *object = base->object; - if (object == NULL || object->type != OB_MESH) { + FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(rbw->group, object) + { + if (object->type != OB_MESH) { continue; } @@ -1481,14 +1476,14 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) /* Needed to get correct base values. */ add_relation(trans_op, sim_key, "Base Ob Transform -> Rigidbody Sim Eval"); } + FOREACH_COLLECTION_OBJECT_RECURSIVE_END; } /* constraints */ if (rbw->constraints) { - const ListBase constraint_objects = BKE_collection_object_cache_get(rbw->constraints); - LISTBASE_FOREACH (Base *, base, &constraint_objects) { - Object *object = base->object; - if (object == NULL || !object->rigidbody_constraint) { + FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(rbw->constraints, object) + { + if (!object->rigidbody_constraint) { continue; } @@ -1508,6 +1503,7 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) /* - ensure that sim depends on this constraint's transform */ add_relation(trans_key, sim_key, "RigidBodyConstraint Transform -> RB Simulation"); } + FOREACH_COLLECTION_OBJECT_RECURSIVE_END; } } |