From f1111808b84cb5cb64139b154c2fbb2a1c44aa36 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sat, 26 Aug 2023 15:31:34 +0300 Subject: [PATCH] Fix: rename animation curves associated with bone collection properties --- source/blender/animrig/intern/bone_collections.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/blender/animrig/intern/bone_collections.cc b/source/blender/animrig/intern/bone_collections.cc index 3f207f8b359..67964dd77b2 100644 --- a/source/blender/animrig/intern/bone_collections.cc +++ b/source/blender/animrig/intern/bone_collections.cc @@ -18,6 +18,8 @@ #include "MEM_guardedalloc.h" +#include "BKE_animsys.h" + #include "ANIM_armature_iter.hh" #include "ANIM_bone_collections.h" @@ -165,8 +167,14 @@ bool ANIM_armature_bonecoll_move(bArmature *armature, BoneCollection *bcoll, con void ANIM_armature_bonecoll_name_set(bArmature *armature, BoneCollection *bcoll, const char *name) { + char old_name[sizeof(bcoll->name)]; + + BLI_strncpy(old_name, bcoll->name, sizeof(bcoll->name)); + BLI_strncpy(bcoll->name, name, sizeof(bcoll->name)); bonecoll_ensure_name_unique(armature, bcoll); + + BKE_animdata_fix_paths_rename_all(&armature->id, "collections", old_name, bcoll->name); } void ANIM_armature_bonecoll_remove(bArmature *armature, BoneCollection *bcoll)