Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2021-06-01 12:46:43 +0300
committerBastien Montagne <bastien@blender.org>2021-06-01 13:01:06 +0300
commit84e16c499243f6bdeb29f684408f4d206b919ee8 (patch)
tree3336cfc0c1a9da7649cc9f215d61a2acce0a5617 /source/blender
parentdb15c9d1bd9dd85ef1db0df24f4ad56c0b2012fe (diff)
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.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/lib_id.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c
index 8a6fb5b3e9e..2dd0dc2c097 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -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;