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:
authorToni Alatalo <antont@kyperjokki.fi>2005-11-10 21:12:53 +0300
committerToni Alatalo <antont@kyperjokki.fi>2005-11-10 21:12:53 +0300
commit4c76b74b008d40e4e3f2bde138e618103b8cbd62 (patch)
treea9fd1b3a78c01515635727600e64da70872fd246 /source/blender/src/header_action.c
parent44ed7f25b732703cb27eb2afa69b1d7fe54632e0 (diff)
added changing the extending / extrapolation type of the IPO curves of selected actions in the action editor (to the menu - code to handle hotkey (to rise a popup) is there too but unused & untested now).
Diffstat (limited to 'source/blender/src/header_action.c')
-rw-r--r--source/blender/src/header_action.c86
1 files changed, 86 insertions, 0 deletions
diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c
index 7c245132cb7..608153e10b5 100644
--- a/source/blender/src/header_action.c
+++ b/source/blender/src/header_action.c
@@ -106,6 +106,11 @@
#define ACTMENU_KEY_INTERP_LINEAR 1
#define ACTMENU_KEY_INTERP_BEZIER 2
+#define ACTMENU_KEY_EXTEND_CONST 0
+#define ACTMENU_KEY_EXTEND_EXTRAPOLATION 1
+#define ACTMENU_KEY_EXTEND_CYCLIC 2
+#define ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION 3
+
void do_action_buttons(unsigned short event)
{
Object *ob= OBACT;
@@ -587,6 +592,84 @@ static uiBlock *action_keymenu_intpolmenu(void *arg_unused)
return block;
}
+static void do_action_keymenu_extendmenu(void *arg, int event)
+{
+ Key *key;
+
+ key = get_action_mesh_key();
+
+ switch(event)
+ {
+ case ACTMENU_KEY_EXTEND_CONST:
+ if (key) {
+ /* to do */
+ }
+ else {
+ set_extendtype_actionchannels(SET_EXTEND_CONSTANT);
+ }
+ break;
+ case ACTMENU_KEY_EXTEND_EXTRAPOLATION:
+ if (key) {
+ /* to do */
+ }
+ else {
+ set_extendtype_actionchannels(SET_EXTEND_EXTRAPOLATION);
+ }
+ break;
+ case ACTMENU_KEY_EXTEND_CYCLIC:
+ if (key) {
+ /* to do */
+ }
+ else {
+ set_extendtype_actionchannels(SET_EXTEND_CYCLIC);
+ }
+ break;
+ case ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION:
+ if (key) {
+ /* to do */
+ }
+ else {
+ set_extendtype_actionchannels(SET_EXTEND_CYCLICEXTRAPOLATION);
+ }
+ break;
+ }
+
+ scrarea_queue_winredraw(curarea);
+}
+
+static uiBlock *action_keymenu_extendmenu(void *arg_unused)
+{
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiNewBlock(&curarea->uiblocks, "action_keymenu_extendmenu",
+ UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
+ uiBlockSetButmFunc(block, do_action_keymenu_extendmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
+ "Constant", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 0,
+ ACTMENU_KEY_EXTEND_CONST, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
+ "Extrapolation", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 0,
+ ACTMENU_KEY_EXTEND_EXTRAPOLATION, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
+ "Cyclic", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 0,
+ ACTMENU_KEY_EXTEND_CYCLIC, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
+ "Cyclic Extrapolation", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 0,
+ ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION, "");
+
+ uiBlockSetDirection(block, UI_RIGHT);
+ uiTextBoundsBlock(block, 60);
+
+ return block;
+}
+
+
static void do_action_keymenu(void *arg, int event)
{
SpaceAction *saction;
@@ -669,6 +752,9 @@ static uiBlock *action_keymenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6,
menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefIconTextBlockBut(block, action_keymenu_extendmenu,
+ NULL, ICON_RIGHTARROW_THIN,
+ "Extend Mode", 0, yco-=20, 120, 20, "");
uiDefIconTextBlockBut(block, action_keymenu_intpolmenu,
NULL, ICON_RIGHTARROW_THIN,
"Interpolation Mode", 0, yco-=20, 120, 20, "");