[Bf-blender-cvs] [68db023329b] blender-v3.3-release: ID namemap: fix missing removal of old name in do_versions_rename_id
Aras Pranckevicius
noreply at git.blender.org
Thu Jul 28 20:26:39 CEST 2022
Commit: 68db023329b77ac06e2a7c7881391631e986c79d
Author: Aras Pranckevicius
Date: Thu Jul 28 21:26:30 2022 +0300
Branches: blender-v3.3-release
https://developer.blender.org/rB68db023329b77ac06e2a7c7881391631e986c79d
ID namemap: fix missing removal of old name in do_versions_rename_id
Was causing an assert that the old name exists in the name map, but
is not present in the actual database. Reported in #blender-coders
===================================================================
M source/blender/blenloader/intern/versioning_common.cc
===================================================================
diff --git a/source/blender/blenloader/intern/versioning_common.cc b/source/blender/blenloader/intern/versioning_common.cc
index d2a55f6f37e..823385727e1 100644
--- a/source/blender/blenloader/intern/versioning_common.cc
+++ b/source/blender/blenloader/intern/versioning_common.cc
@@ -18,6 +18,7 @@
#include "BKE_animsys.h"
#include "BKE_lib_id.h"
#include "BKE_main.h"
+#include "BKE_main_namemap.h"
#include "BKE_node.h"
#include "MEM_guardedalloc.h"
@@ -66,6 +67,7 @@ ID *do_versions_rename_id(Main *bmain,
}
}
if (id != nullptr) {
+ BKE_main_namemap_remove_name(bmain, id, id->name + 2);
BLI_strncpy(id->name + 2, name_dst, sizeof(id->name) - 2);
/* We know it's unique, this just sorts. */
BLI_libblock_ensure_unique_name(bmain, id->name);
More information about the Bf-blender-cvs
mailing list