mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
GPencil: Fix unreported animation data missing when change palette name
When a palette was renamed, the animation data was not changed.
This fix is related to commit 196520fe7d
This commit is contained in:
parent
e5d8c2a67f
commit
520afa2962
1 changed files with 5 additions and 0 deletions
|
|
@ -784,11 +784,16 @@ static void rna_GPencilPalette_info_set(PointerRNA *ptr, const char *value)
|
|||
bGPdata *gpd = ptr->id.data;
|
||||
bGPDpalette *palette = ptr->data;
|
||||
|
||||
char oldname[64] = "";
|
||||
BLI_strncpy(oldname, palette->info, sizeof(oldname));
|
||||
|
||||
/* copy the new name into the name slot */
|
||||
BLI_strncpy_utf8(palette->info, value, sizeof(palette->info));
|
||||
|
||||
BLI_uniquename(&gpd->palettes, palette, DATA_("GP_Palette"), '.', offsetof(bGPDpalette, info),
|
||||
sizeof(palette->info));
|
||||
/* now fix animation paths */
|
||||
BKE_animdata_fix_paths_rename_all(&gpd->id, "palettes", oldname, palette->info);
|
||||
}
|
||||
|
||||
static char *rna_GPencilPalette_path(PointerRNA *ptr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue