[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20069] branches/blender2.5/blender/source /blender/editors/interface/interface_anim.c: 2.5 Buttons - Insert/ Delete Keyframe Menu Tweaks

Joshua Leung aligorith at gmail.com
Tue May 5 11:56:22 CEST 2009


Revision: 20069
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20069
Author:   aligorith
Date:     2009-05-05 11:56:22 +0200 (Tue, 05 May 2009)

Log Message:
-----------
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.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/interface/interface_anim.c

Modified: branches/blender2.5/blender/source/blender/editors/interface/interface_anim.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/interface_anim.c	2009-05-05 09:43:11 UTC (rev 20068)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface_anim.c	2009-05-05 09:56:22 UTC (rev 20069)
@@ -121,36 +121,49 @@
 	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);





More information about the Bf-blender-cvs mailing list