diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-25 15:21:15 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-25 18:15:07 +0300 |
commit | c2110213ca7a6b8ba2392cf6e8f5a61b7ba4b554 (patch) | |
tree | dfdf68849767fc5f04dda17b0b8db5c97b3e7e07 /source/blender/blenkernel/intern/collection.c | |
parent | 2c9b32949bc00e73603bcabadb74e5b3176a161a (diff) |
Physics: update softbody and dynamic paint to get colliders from depsgraph.
Because looping over the scene is unsafe and slow.
Diffstat (limited to 'source/blender/blenkernel/intern/collection.c')
-rw-r--r-- | source/blender/blenkernel/intern/collection.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index 8a3d27ca790..1d9cc9bb8d0 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -364,36 +364,13 @@ void BKE_collection_object_cache_free(Collection *collection) collection_object_cache_free(collection); } -Base *BKE_collection_or_layer_objects(const Depsgraph *depsgraph, - const Scene *scene, - const ViewLayer *view_layer, - Collection *collection) +Base *BKE_collection_or_layer_objects(const ViewLayer *view_layer, Collection *collection) { - // TODO: this is used by physics to get objects from a collection, but the - // the physics systems are not all using the depsgraph correctly which means - // we try different things. Instead we should explicitly get evaluated or - // non-evaluated data and always have the depsgraph available when needed - if (collection) { return BKE_collection_object_cache_get(collection).first; } - else if (depsgraph) { - view_layer = DEG_get_evaluated_view_layer(depsgraph); - - if (view_layer) { - return FIRSTBASE(view_layer); - } - else { - view_layer = DEG_get_input_view_layer(depsgraph); - return FIRSTBASE(view_layer); - } - } - else if (view_layer) { - return FIRSTBASE(view_layer); - } else { - /* depsgraph is NULL during deg build */ - return FIRSTBASE(BKE_view_layer_context_active_PLACEHOLDER(scene)); + return FIRSTBASE(view_layer); } } |