diff options
author | Bastien Montagne <bastien@blender.org> | 2022-08-31 15:47:52 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-08-31 15:47:52 +0300 |
commit | 773241add9d876aa0b4ba011745208f61b53a4e2 (patch) | |
tree | 5a62a03b6785f900c4265e2a2e56b2f662cd57bb /source/blender | |
parent | 4b9d7b71e0075e0b590c5e8d8f9bb67cb6a1e2de (diff) | |
parent | 24fe659224b281ceca64f71f372f12f5905f6a77 (diff) |
Merge branch 'blender-v3.3-release'
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 8f563fa388a..cfbb0a724b7 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -2356,6 +2356,25 @@ static int make_override_library_exec(bContext *C, wmOperator *op) BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); + /* For the time being, replace selected linked objects by their overrides in all collections. + * While this may not be the absolute best behavior in all cases, in most common one this should + * match the expected result. */ + if (user_overrides_objects_uids != NULL) { + LISTBASE_FOREACH (Collection *, coll_iter, &bmain->collections) { + if (ID_IS_LINKED(coll_iter)) { + continue; + } + LISTBASE_FOREACH (CollectionObject *, coll_ob_iter, &coll_iter->gobject) { + if (BLI_gset_haskey(user_overrides_objects_uids, + POINTER_FROM_UINT(coll_ob_iter->ob->id.session_uuid))) { + /* Tag for remapping when creating overrides. */ + coll_iter->id.tag |= LIB_TAG_DOIT; + break; + } + } + } + } + ID *id_root_override; const bool success = BKE_lib_override_library_create(bmain, scene, |