From a80b7d612947e1d26b10165a37bb603dae527afd Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 8 Mar 2012 14:04:06 +0000 Subject: =?UTF-8?q?Fixing=20several=20issues=20with=20keyingsets:=20*Add?= =?UTF-8?q?=20a=20new=20idname=20to=20keyingsets,=20keeping=20name=20as=20?= =?UTF-8?q?label-only=20(using=20same=20string=20for=20both=20made=20looku?= =?UTF-8?q?p=20fail=20when=20using=20i18n=20other=20than=20english,=20as?= =?UTF-8?q?=20it=20tried=20to=20compare=20an=20untranslated=20static=20str?= =?UTF-8?q?ing=20id=20against=20a=20translated=20RNA=20name).=20Also=20add?= =?UTF-8?q?ing=20a=20description=20string=20(can=20be=20helpful=20with=20c?= =?UTF-8?q?ustom=20keyingsets,=20imho).=20*Fixed=20a=20few=20other=20bugs?= =?UTF-8?q?=20related=20to=20that=20area=20(namely,=20you=20can=E2=80=99t?= =?UTF-8?q?=20deselect=20current=20keyingset=20from=20the=20shift-ctrl-alt?= =?UTF-8?q?-I=20popup=20menu,=20and=20insert/delete=20key=20ops=20were=20u?= =?UTF-8?q?sing=20a=20rather=20strange=20way=20to=20get=20chosen=20custom?= =?UTF-8?q?=20keyingset=E2=80=A6).=20*Fixed=20UI=20code=20so=20that=20it?= =?UTF-8?q?=20always=20uses=20(RNA)=20enum,=20and=20simplified=20menu-crea?= =?UTF-8?q?tion=20code.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/blender/blenkernel/intern/anim_sys.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/anim_sys.c') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index db8bd8f2066..3a08120f067 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -941,14 +941,16 @@ KS_Path *BKE_keyingset_find_path (KeyingSet *ks, ID *id, const char group_name[] /* Defining Tools --------------------------- */ /* Used to create a new 'custom' KeyingSet for the user, that will be automatically added to the stack */ -KeyingSet *BKE_keyingset_add (ListBase *list, const char name[], short flag, short keyingflag) +KeyingSet *BKE_keyingset_add (ListBase *list, const char idname[], const char name[], short flag, short keyingflag) { KeyingSet *ks; /* allocate new KeyingSet */ ks= MEM_callocN(sizeof(KeyingSet), "KeyingSet"); - BLI_strncpy(ks->name, name ? name : "KeyingSet", sizeof(ks->name)); + BLI_strncpy(ks->idname, idname ? idname : name ? name : "KeyingSet", sizeof(ks->idname)); + + BLI_strncpy(ks->name, name ? name : idname ? idname : "Keying Set", sizeof(ks->name)); ks->flag= flag; ks->keyingflag= keyingflag; @@ -956,8 +958,11 @@ KeyingSet *BKE_keyingset_add (ListBase *list, const char name[], short flag, sho /* add KeyingSet to list */ BLI_addtail(list, ks); - /* make sure KeyingSet has a unique name (this helps with identification) */ - BLI_uniquename(list, ks, "KeyingSet", '.', offsetof(KeyingSet, name), sizeof(ks->name)); + /* Make sure KeyingSet has a unique idname. */ + BLI_uniquename(list, ks, "KeyingSet", '.', offsetof(KeyingSet, idname), sizeof(ks->idname)); + + /* Make sure KeyingSet has a unique label (this helps with identification). */ + BLI_uniquename(list, ks, "Keying Set", '.', offsetof(KeyingSet, name), sizeof(ks->name)); /* return new KeyingSet for further editing */ return ks; -- cgit v1.2.3