diff options
author | Bastien Montagne <bastien@blender.org> | 2022-05-13 19:05:44 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-05-13 19:05:44 +0300 |
commit | 074c695a0d4de88550be71181690639ab6b16dcf (patch) | |
tree | 343529d2abfb3aa3a9806c7d0217b017c910020e /source/blender/blenkernel/intern/blendfile_link_append.c | |
parent | ca2fb9bae9e9920bb1049863c7bddc5d7ebd1884 (diff) |
Fix T98072: Regression: When appending a Scene, the Collections that are excluded get instanced into Current Scene.
This was due to using `BKE_scene_has_object` function, which uses the
cache of bases of the viewlayers, which do not have entries for the
content of excluded collections... Now use
`BKE_collection_has_object_recursive` instead.
Diffstat (limited to 'source/blender/blenkernel/intern/blendfile_link_append.c')
-rw-r--r-- | source/blender/blenkernel/intern/blendfile_link_append.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/blendfile_link_append.c b/source/blender/blenkernel/intern/blendfile_link_append.c index 555c4690308..f9eea52360e 100644 --- a/source/blender/blenkernel/intern/blendfile_link_append.c +++ b/source/blender/blenkernel/intern/blendfile_link_append.c @@ -400,7 +400,9 @@ typedef struct LooseDataInstantiateContext { static bool object_in_any_scene(Main *bmain, Object *ob) { LISTBASE_FOREACH (Scene *, sce, &bmain->scenes) { - if (BKE_scene_object_find(sce, ob)) { + /* #BKE_scene_has_object checks bases cache of the scenes' viewlayer, not actual content of + * their collections. */ + if (BKE_collection_has_object_recursive(sce->master_collection, ob)) { return true; } } |