From 040ff38fcd1d3214ba46fe688376f518ce937050 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 21 Mar 2024 17:26:45 +0100 Subject: [PATCH] Fix: ID namemap assert in auto smooth versioning code When "moving" the new node group to the same library as the object, its original name has to be cleared from the name-map as well. That's because there is a separate name-map for each library. I had this in the original PR, but incorrectly removed this because I thought it was unnecessary. Pull Request: https://projects.blender.org/blender/blender/pulls/119747 --- source/blender/blenkernel/intern/mesh_legacy_convert.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/blenkernel/intern/mesh_legacy_convert.cc b/source/blender/blenkernel/intern/mesh_legacy_convert.cc index d18b185b544..76a67d8ed68 100644 --- a/source/blender/blenkernel/intern/mesh_legacy_convert.cc +++ b/source/blender/blenkernel/intern/mesh_legacy_convert.cc @@ -37,6 +37,7 @@ #include "BKE_idprop.hh" #include "BKE_lib_id.hh" #include "BKE_main.hh" +#include "BKE_main_namemap.hh" #include "BKE_mesh.hh" #include "BKE_mesh_legacy_convert.hh" #include "BKE_modifier.hh" @@ -2381,6 +2382,7 @@ void BKE_main_mesh_legacy_convert_auto_smooth(Main &bmain) /* Move the node group to the requested library so that library data-blocks don't point to * local data-blocks. This requires making sure the name is unique in that library and * changing the name maps to be consistent with the new state. */ + BKE_main_namemap_remove_name(&bmain, &new_group->id, new_group->id.name + 2); new_group->id.lib = library; BKE_id_new_name_validate(&bmain, &bmain.nodetrees, &new_group->id, nullptr, false); if (library) {