diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-03-08 18:04:06 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-03-08 18:04:06 +0400 |
commit | a80b7d612947e1d26b10165a37bb603dae527afd (patch) | |
tree | 7a575b2f99b093e43d50d9322f8d1c50477b0fa6 /source/blender/editors/animation/keyframing.c | |
parent | a5f2db9992327764126ee7f275294d1f0699a26a (diff) |
Fixing several issues with keyingsets:
*Add a new idname to keyingsets, keeping name as label-only (using same string for both made lookup fail when using i18n other than english, as it tried to compare an untranslated static string id against a translated RNA name). Also adding a description string (can be helpful with custom keyingsets, imho).
*Fixed a few other bugs related to that area (namely, you can’t deselect current keyingset from the shift-ctrl-alt-I popup menu, and insert/delete key ops were using a rather strange way to get chosen custom keyingset…).
*Fixed UI code so that it always uses (RNA) enum, and simplified menu-creation code.
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 559f6ad98d9..e82f234d2b6 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -71,6 +71,7 @@ #include "ED_screen.h" #include "UI_interface.h" +#include "UI_resources.h" #include "WM_api.h" #include "WM_types.h" @@ -1115,7 +1116,7 @@ static int insert_key_exec (bContext *C, wmOperator *op) if (type == 0) type= scene->active_keyingset; if (type > 0) - ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1); + ks= BLI_findlink(&scene->keyingsets, type-1); else ks= BLI_findlink(&builtin_keyingsets, -type-1); @@ -1193,8 +1194,15 @@ static int insert_key_menu_invoke (bContext *C, wmOperator *op, wmEvent *UNUSED( /* if prompting or no active Keying Set, show the menu */ if ((scene->active_keyingset == 0) || RNA_boolean_get(op->ptr, "always_prompt")) { + uiPopupMenu *pup; + uiLayout *layout; + /* call the menu, which will call this operator again, hence the canceled */ - ANIM_keying_sets_menu_setup(C, op->type->name, "ANIM_OT_keyframe_insert_menu"); + pup = uiPupMenuBegin(C, op->type->name, ICON_NONE); + layout = uiPupMenuLayout(pup); + uiItemsEnumO(layout, "ANIM_OT_keyframe_insert_menu", "type"); + uiPupMenuEnd(C, pup); + return OPERATOR_CANCELLED; } else { @@ -1264,7 +1272,7 @@ static int delete_key_exec (bContext *C, wmOperator *op) if (type == 0) type= scene->active_keyingset; if (type > 0) - ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1); + ks= BLI_findlink(&scene->keyingsets, type-1); else ks= BLI_findlink(&builtin_keyingsets, -type-1); |