1
1

Fix BLI_libblock_ensure_unique_name not ignoring linked IDs.

This function would considere that there was a name conflict even in
case existing ID would be a linked one.

This is only a (symbolic) perforance improvement and logical fix, since
`BKE_id_new_name_validate` would not do that mistake anyway.
This commit is contained in:
2021-06-01 11:46:43 +02:00
parent db15c9d1bd
commit 84e16c4992

View File

@@ -2198,7 +2198,7 @@ void BLI_libblock_ensure_unique_name(Main *bmain, const char *name)
/* search for id */
idtest = BLI_findstring(lb, name + 2, offsetof(ID, name) + 2);
if (idtest != NULL) {
if (idtest != NULL && !ID_IS_LINKED(idtest)) {
/* BKE_id_new_name_validate also takes care of sorting. */
BKE_id_new_name_validate(lb, idtest, NULL, false);
bmain->is_memfile_undo_written = false;