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/collision.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/collision.c')
-rw-r--r-- | source/blender/blenkernel/intern/collision.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 1debdbb847e..a734e140932 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -518,7 +518,7 @@ static void add_collision_object(ListBase *relations, Object *ob, int level, uns ListBase *BKE_collision_relations_create(Depsgraph *depsgraph, Collection *collection, unsigned int modifier_type) { ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph); - Base *base = BKE_collection_or_layer_objects(NULL, NULL, view_layer, collection); + Base *base = BKE_collection_or_layer_objects(view_layer, collection); const bool for_render = (DEG_get_mode(depsgraph) == DAG_EVAL_RENDER); const int base_flag = (for_render) ? BASE_ENABLED_RENDER : BASE_ENABLED_VIEWPORT; @@ -548,6 +548,7 @@ Object **BKE_collision_objects_create(Depsgraph *depsgraph, Object *self, Collec ListBase *relations = DEG_get_collision_relations(depsgraph, collection, modifier_type); if (!relations) { + *numcollobj = 0; return NULL; } |