diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-06-11 20:34:21 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-06-11 20:34:21 +0300 |
commit | 5114637967b5d57de9176a01e5c180bab909dd63 (patch) | |
tree | 8bf5b66ce97411ae2a343cf1a9cc36da6b967fad /source/blender/makesrna/intern/rna_mask.c | |
parent | 8c2619a11a155ecd8c331eb383a9c0749bb965ab (diff) |
Fix T45016, mask animation data lost after layer rename
We need to fix up animation data.
Diffstat (limited to 'source/blender/makesrna/intern/rna_mask.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_mask.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_mask.c b/source/blender/makesrna/intern/rna_mask.c index afd149a755a..4144872a637 100644 --- a/source/blender/makesrna/intern/rna_mask.c +++ b/source/blender/makesrna/intern/rna_mask.c @@ -213,10 +213,13 @@ static void rna_MaskLayer_name_set(PointerRNA *ptr, const char *value) { Mask *mask = (Mask *)ptr->id.data; MaskLayer *masklay = (MaskLayer *)ptr->data; + char oldname[sizeof(masklay->name)], newname[sizeof(masklay->name)]; - BLI_strncpy(masklay->name, value, sizeof(masklay->name)); + /* need to be on the stack */ + BLI_strncpy(oldname, masklay->name, sizeof(masklay->name)); + BLI_strncpy_utf8(newname, value, sizeof(masklay->name)); - BKE_mask_layer_unique_name(mask, masklay); + BKE_mask_layer_rename(mask, masklay, oldname, newname); } static PointerRNA rna_MaskLayer_active_spline_get(PointerRNA *ptr) |