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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user