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>2006-12-02 09:00:31 +0300
committerJoshua Leung <aligorith@gmail.com>2006-12-02 09:00:31 +0300
commitac43fe5afdb4eb2d5684c686c31b087495e350d9 (patch)
treeac8f751c58f7e2dfec18b3c0d7186b557f87b3d0 /source/blender/src/header_action.c
parent28bbf2d61616f7b8b3c59b54b46af7ee4dbf1e11 (diff)
== Action Editor ==
Now it is possible to mirror selected keyframes in the action editor; either over the current frame or the vertical axis. Hotkey is: SHIFT M (like in ipo editor).
Diffstat (limited to 'source/blender/src/header_action.c')
-rw-r--r--source/blender/src/header_action.c52
1 files changed, 46 insertions, 6 deletions
diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c
index 3c06078b467..194d4976f51 100644
--- a/source/blender/src/header_action.c
+++ b/source/blender/src/header_action.c
@@ -101,7 +101,6 @@
#define ACTMENU_KEY_DELETE 1
#define ACTMENU_KEY_BAKE 2
#define ACTMENU_KEY_CLEAN 3
-#define ACTMENU_KEY_MIRROR 4
#define ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_UP 0
#define ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_DOWN 1
@@ -126,8 +125,11 @@
#define ACTMENU_KEY_EXTEND_CYCLIC 2
#define ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION 3
-#define ACTMENU_KEY_SNAP_NEARFRAME 0
-#define ACTMENU_KEY_SNAP_CURFRAME 1
+#define ACTMENU_KEY_SNAP_NEARFRAME 1
+#define ACTMENU_KEY_SNAP_CURFRAME 2
+
+#define ACTMENU_KEY_MIRROR_CURFRAME 1
+#define ACTMENU_KEY_MIRROR_YAXIS 2
#define ACTMENU_MARKERS_ADD 0
#define ACTMENU_MARKERS_DUPLICATE 1
@@ -832,10 +834,8 @@ static void do_action_keymenu_snapmenu(void *arg, int event)
switch(event)
{
case ACTMENU_KEY_SNAP_NEARFRAME:
- snap_keys_to_frame(1);
- break;
case ACTMENU_KEY_SNAP_CURFRAME:
- snap_keys_to_frame(2);
+ snap_keys_to_frame(event);
break;
}
@@ -866,6 +866,43 @@ static uiBlock *action_keymenu_snapmenu(void *arg_unused)
return block;
}
+static void do_action_keymenu_mirrormenu(void *arg, int event)
+{
+ switch(event)
+ {
+ case ACTMENU_KEY_MIRROR_CURFRAME:
+ case ACTMENU_KEY_MIRROR_YAXIS:
+ mirror_action_keys(event);
+ break;
+ }
+
+ scrarea_queue_winredraw(curarea);
+}
+
+static uiBlock *action_keymenu_mirrormenu(void *arg_unused)
+{
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiNewBlock(&curarea->uiblocks, "action_keymenu_mirrormenu",
+ UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
+ uiBlockSetButmFunc(block, do_action_keymenu_mirrormenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
+ "Current Frame|Shift M, 1", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 0,
+ ACTMENU_KEY_MIRROR_CURFRAME, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
+ "Vertical Axis|Shift M, 2", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 0,
+ ACTMENU_KEY_MIRROR_YAXIS, "");
+
+ uiBlockSetDirection(block, UI_RIGHT);
+ uiTextBoundsBlock(block, 60);
+
+ return block;
+}
+
static void do_action_keymenu(void *arg, int event)
{
SpaceAction *saction;
@@ -926,6 +963,9 @@ static uiBlock *action_keymenu(void *arg_unused)
uiDefIconTextBlockBut(block, action_keymenu_snapmenu,
NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 20, "");
+ uiDefIconTextBlockBut(block, action_keymenu_mirrormenu,
+ NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 20, "");
+
uiDefBut(block, SEPR, 0, "", 0, yco-=6,
menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");