diff options
author | Bastien Montagne <bastien@blender.org> | 2020-11-30 19:17:43 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-11-30 19:19:27 +0300 |
commit | 3bdc42f97a837766aec2bcd57917ef631570304f (patch) | |
tree | 968fcadf4654570d8fda2b41d0aa0e35bebf8e61 /source/blender/blenkernel | |
parent | a7cf6ad5471e4109d60d99c49b58d7257c95e392 (diff) |
Fix T82996: Library Overrides: Duplicate of overridden collection on Resync
Properly use given reference pointer in
`lib_override_library_create_post_process` when it is a Collection one
too.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index bcefcd5f001..d82315a0e7f 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -551,6 +551,10 @@ static void lib_override_library_create_post_process( if (ob_reference != NULL) { BKE_collection_add_from_object(bmain, scene, ob_reference, collection_new); } + else if (id_reference != NULL) { + BKE_collection_add_from_collection( + bmain, scene, ((Collection *)id_reference), collection_new); + } else { BKE_collection_add_from_collection(bmain, scene, ((Collection *)id_root), collection_new); } @@ -841,6 +845,10 @@ bool BKE_lib_override_library_resync(Main *bmain, Scene *scene, ViewLayer *view_ id_root = id_root_reference->newid; /* Essentially ensures that potentially new overrides of new objects will be instantiated. */ + /* Note: Here 'reference' collection and 'newly added' collection are the same, which is fine + * since we already relinked old root override collection to new resync'ed one above. So this + * call is not expected to instantiate this new resync'ed collection anywhere, just to ensure + * that we do not have any stray objects. */ lib_override_library_create_post_process(bmain, scene, view_layer, id_root_reference, id_root); /* Cleanup. */ |