[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19079] branches/blender2.5/blender/source /blender/editors/animation/anim_channels.c: Animation Editors: Added Tab-Key to toggle editability of selected channels.

Joshua Leung aligorith at gmail.com
Sun Feb 22 06:55:55 CET 2009


Revision: 19079
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19079
Author:   aligorith
Date:     2009-02-22 06:55:37 +0100 (Sun, 22 Feb 2009)

Log Message:
-----------
Animation Editors: Added Tab-Key to toggle editability of selected channels.

Ton - Currently, I've had to add a new operator to set this, since it is not possible to specify via keymaps whether the invoke or exec should be called by default for an operator. 
(See corresponding mail on 2.5 mailing list for details about this)

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c

Modified: branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c	2009-02-22 05:34:47 UTC (rev 19078)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c	2009-02-22 05:55:37 UTC (rev 19079)
@@ -867,6 +867,27 @@
 	RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
 }
 
+// XXX currently, this is a separate operator, but perhaps we could in future specify in keymaps whether to call invoke or exec?
+void ANIM_OT_channels_toggle_editable (wmOperatorType *ot)
+{
+	/* identifiers */
+	ot->name= "Toggle Channel Editability";
+	ot->idname= "ANIM_OT_channels_toggle_editable";
+	
+	/* api callbacks */
+	ot->exec= animchannels_setflag_exec;
+	ot->poll= ED_operator_areaactive;
+	
+	/* flags */
+	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+	
+	/* props */
+		/* flag-setting mode */
+	RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_TOGGLE, "Mode", "");
+		/* setting to set */
+	RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, ACHANNEL_SETTING_PROTECT, "Type", "");
+}
+
 /* ********************** Select All Operator *********************** */
 
 static int animchannels_deselectall_exec(bContext *C, wmOperator *op)
@@ -1389,6 +1410,9 @@
 	WM_operatortype_append(ANIM_OT_channels_disable_setting);
 	WM_operatortype_append(ANIM_OT_channels_toggle_setting);
 	
+		// XXX does this need to be a separate operator?
+	WM_operatortype_append(ANIM_OT_channels_toggle_editable);
+	
 		// XXX these need to be updated for new system... todo...
 	//WM_operatortype_append(ANIM_OT_channels_move_up);
 	//WM_operatortype_append(ANIM_OT_channels_move_down);
@@ -1421,6 +1445,9 @@
 	WM_keymap_add_item(keymap, "ANIM_OT_channels_enable_setting", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
 	WM_keymap_add_item(keymap, "ANIM_OT_channels_disable_setting", WKEY, KM_PRESS, KM_ALT, 0);
 	
+	/* settings - specialised hotkeys */
+	WM_keymap_add_item(keymap, "ANIM_OT_channels_toggle_editable", TABKEY, KM_PRESS, 0, 0);
+	
 	/* rearranging - actions only */
 	//WM_keymap_add_item(keymap, "ANIM_OT_channels_move_up", PAGEUPKEY, KM_PRESS, KM_SHIFT, 0);
 	//WM_keymap_add_item(keymap, "ANIM_OT_channels_move_down", PAGEDOWNKEY, KM_PRESS, KM_SHIFT, 0);





More information about the Bf-blender-cvs mailing list