Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-05-05 13:56:22 +0400
committerJoshua Leung <aligorith@gmail.com>2009-05-05 13:56:22 +0400
commit71c38978e14ebf3522fe60fc239ad04f10ef30ab (patch)
tree2190f4fbeea31d456492593375ae23840dc72ad9
parent42bc76511d829e2fc9002ee7a6f95f30cbb00a42 (diff)
2.5 Buttons - Insert/Delete Keyframe Menu Tweaks
* Added 'Replace Keyframes' entry that appears in addition to delete, since it is often useful to be able to directly replace values instead of having to delete and reinsert keyframes. Internally, this just calls the Insert Keyframe operator. * Separated the code to for Driver editing from the tests for keyframes, since they're independent. * Added separators between keyframe and driver operations. This could be removed if the UI-mafia consider it overkill.
-rw-r--r--source/blender/editors/interface/interface_anim.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index af8aa91f358..ac6f5d970eb 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -121,36 +121,49 @@ void ui_but_anim_menu(bContext *C, uiBut *but)
if(but->rnapoin.data && but->rnaprop) {
pup= uiPupMenuBegin(RNA_property_ui_name(but->rnaprop), 0);
layout= uiPupMenuLayout(pup);
-
+
length= RNA_property_array_length(but->rnaprop);
-
+
if(but->flag & UI_BUT_ANIMATED_KEY) {
if(length) {
+ uiItemBooleanO(layout, "Replace Keyframes", 0, "ANIM_OT_insert_keyframe_button", "all", 1);
+ uiItemBooleanO(layout, "Replace Single Keyframe", 0, "ANIM_OT_insert_keyframe_button", "all", 0);
uiItemBooleanO(layout, "Delete Keyframes", 0, "ANIM_OT_delete_keyframe_button", "all", 1);
uiItemBooleanO(layout, "Delete Single Keyframe", 0, "ANIM_OT_delete_keyframe_button", "all", 0);
-
- uiItemBooleanO(layout, "Remove Driver", 0, "ANIM_OT_remove_driver_button", "all", 1);
- uiItemBooleanO(layout, "Remove Single Driver", 0, "ANIM_OT_remove_driver_button", "all", 0);
}
else {
+ uiItemBooleanO(layout, "Replace Keyframe", 0, "ANIM_OT_insert_keyframe_button", "all", 0);
uiItemBooleanO(layout, "Delete Keyframe", 0, "ANIM_OT_delete_keyframe_button", "all", 0);
-
- uiItemBooleanO(layout, "Remove Driver", 0, "ANIM_OT_remove_driver_button", "all", 0);
}
}
else if(RNA_property_animateable(&but->rnapoin, but->rnaprop)) {
if(length) {
uiItemBooleanO(layout, "Insert Keyframes", 0, "ANIM_OT_insert_keyframe_button", "all", 1);
uiItemBooleanO(layout, "Insert Single Keyframe", 0, "ANIM_OT_insert_keyframe_button", "all", 0);
-
+ }
+ else
+ uiItemBooleanO(layout, "Insert Keyframe", 0, "ANIM_OT_insert_keyframe_button", "all", 0);
+ }
+
+ if(but->flag & UI_BUT_DRIVEN) {
+ uiItemS(layout);
+
+ if(length) {
+ uiItemBooleanO(layout, "Remove Driver", 0, "ANIM_OT_remove_driver_button", "all", 1);
+ uiItemBooleanO(layout, "Remove Single Driver", 0, "ANIM_OT_remove_driver_button", "all", 0);
+ }
+ else
+ uiItemBooleanO(layout, "Remove Driver", 0, "ANIM_OT_remove_driver_button", "all", 0);
+ }
+ else if(RNA_property_animateable(&but->rnapoin, but->rnaprop)) {
+ uiItemS(layout);
+
+ if(length) {
uiItemBooleanO(layout, "Add Driver", 0, "ANIM_OT_add_driver_button", "all", 1);
uiItemBooleanO(layout, "Add Single Driver", 0, "ANIM_OT_add_driver_button", "all", 0);
}
- else {
- uiItemBooleanO(layout, "Insert Keyframe", 0, "ANIM_OT_insert_keyframe_button", "all", 0);
-
+ else
uiItemBooleanO(layout, "Add Driver", 0, "ANIM_OT_add_driver_button", "all", 0);
- }
}
uiPupMenuEnd(C, pup);