From b67fe05d4bea2d3c9efbd127e9d9dc3a897e89e6 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 26 Apr 2021 16:35:22 +0200 Subject: Depsgraph: support depending on collection geometry This fixes T87666 and T83252. The boolean modifier and geometry nodes can depend on the geometry of an entire collection. Before, the modifiers had to manually create relations to all the objects in the collection. This worked for the most part, but was cumbersome and did not solve all issues. For example, the modifiers were not properly updated when objects were added/removed from the referenced collection. This commit introduces the concept of "collection geometry" in the depsgraph. The geometry of a collection depends on the transforms and geometry of all the objects in it. The boolean modifier and geometry nodes can now just depend on the collection geometry instead of creating all the dependencies themselves. Differential Revision: https://developer.blender.org/D11053 --- source/blender/blenkernel/intern/collection.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/blenkernel/intern/collection.c') diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index b29dd007c51..3170c3aa65c 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -1150,6 +1150,8 @@ bool BKE_collection_object_add(Main *bmain, Collection *collection, Object *ob) BKE_main_collection_sync(bmain); } + DEG_id_tag_update(&collection->id, ID_RECALC_GEOMETRY); + return true; } @@ -1201,6 +1203,8 @@ bool BKE_collection_object_remove(Main *bmain, BKE_main_collection_sync(bmain); } + DEG_id_tag_update(&collection->id, ID_RECALC_GEOMETRY); + return true; } -- cgit v1.2.3