From 15ef88b90239af30b08e798cc57cea317f1d56c9 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 4 Sep 2009 07:26:32 +0000 Subject: Keying Sets: Added options to add/remove properties from the active Keying Set to the RMB menu (and also via KKEY and ALT-K respectively) --- source/blender/editors/interface/interface_anim.c | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source/blender/editors/interface/interface_anim.c') diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index d7904a19bfe..8e15bbde201 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -209,6 +209,18 @@ void ui_but_anim_remove_driver(bContext *C) WM_operator_name_call(C, "ANIM_OT_remove_driver_button", WM_OP_INVOKE_DEFAULT, NULL); } +void ui_but_anim_add_keyingset(bContext *C) +{ + /* this operator calls uiAnimContextProperty above */ + WM_operator_name_call(C, "ANIM_OT_add_keyingset_button", WM_OP_INVOKE_DEFAULT, NULL); +} + +void ui_but_anim_remove_keyingset(bContext *C) +{ + /* this operator calls uiAnimContextProperty above */ + WM_operator_name_call(C, "ANIM_OT_remove_keyingset_button", WM_OP_INVOKE_DEFAULT, NULL); +} + void ui_but_anim_menu(bContext *C, uiBut *but) { uiPopupMenu *pup; @@ -264,6 +276,20 @@ void ui_but_anim_menu(bContext *C, uiBut *but) else uiItemBooleanO(layout, "Add Driver", 0, "ANIM_OT_add_driver_button", "all", 0); } + + if(RNA_property_animateable(&but->rnapoin, but->rnaprop)) { + uiItemS(layout); + + if(length) { + uiItemBooleanO(layout, "Add All to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 1); + uiItemBooleanO(layout, "Add Single to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 0); + uiItemBooleanO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button", "all", 0); + } + else { + uiItemBooleanO(layout, "Add to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 0); + uiItemBooleanO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button", "all", 0); + } + } uiPupMenuEnd(C, pup); } -- cgit v1.2.3