diff options
author | Bastien Montagne <bastien@blender.org> | 2021-03-16 17:08:44 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-03-16 18:57:04 +0300 |
commit | 1ba88d4d2fb0e51f571a8b303bb70941d352e304 (patch) | |
tree | 86cdcdd942978ee6887fedcb3e822f03f77072cc /source/blender | |
parent | 18371f278059c0a2c99b91d5be4886ab3fd4a2a7 (diff) |
LibOverride: Resync: Fix too many objects being rooted in master collection.
No need to instantiate systematically the root object if it is already
instantiated in the scene...
Issue reported by the studio.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index 3f47e11f701..1a5e07dd34f 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -697,8 +697,10 @@ static void lib_override_library_create_post_process( break; } case ID_OB: { - BKE_collection_object_add_from( - bmain, scene, (Object *)id_root, ((Object *)id_root->newid)); + if (BKE_view_layer_base_find(view_layer, (Object *)id_root->newid) == NULL) { + BKE_collection_object_add_from( + bmain, scene, (Object *)id_root, (Object *)id_root->newid); + } break; } default: |