diff options
author | Bastien Montagne <bastien@blender.org> | 2020-09-22 15:49:18 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-09-23 12:07:03 +0300 |
commit | b93b75b5fb716979f88abbc6aedc778c3509e2b5 (patch) | |
tree | bcb42b1f702b160fce85f7c1a99fbe60ac1925d3 /source | |
parent | a6b16cfd801faf0e7ec933fd516227d8e2bc2a2c (diff) |
LibOverride: Tweak override creation code.
This is a first step towards supporting conversion of proxies, done
separately to make it easy to pinpoint in case it would create problems.
It is not expected to cause any change in behavior currently.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index 48ecbcae90c..befb4afc0b7 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -287,11 +287,14 @@ bool BKE_lib_override_library_create_from_tag(Main *bmain) /* Override the IDs. */ for (todo_id_iter = todo_ids.first; todo_id_iter != NULL; todo_id_iter = todo_id_iter->next) { reference_id = todo_id_iter->data; - if ((reference_id->newid = lib_override_library_create_from(bmain, reference_id)) == NULL) { - success = false; - break; - } - /* We also tag the new IDs so that in next step we can remap their pointers too. */ + if (reference_id->newid == NULL) { + /* If newid is already set, assume it has been handled by calling code. + * Only current usecase: re-using proxy ID when converting to liboverride. */ + if ((reference_id->newid = lib_override_library_create_from(bmain, reference_id)) == NULL) { + success = false; + break; + } + } /* We also tag the new IDs so that in next step we can remap their pointers too. */ reference_id->newid->tag |= LIB_TAG_DOIT; Key *reference_key; |