diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2017-01-24 11:15:41 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2017-01-24 11:15:41 +0300 |
commit | 520afa2962f1fc97a04f81a5f6a423dd71cf30f3 (patch) | |
tree | 49ceeb90f4f63b26967499bdf2c59bef175a820b /source/blender/makesrna/intern | |
parent | e5d8c2a67f51261b7865a662d95fb5cb248c2959 (diff) |
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 196520fe7d81
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 25cd7265c3e..6e0d6ad2bcd 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -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) |