diff options
author | Martin Poirier <theeth@yahoo.com> | 2006-10-01 23:45:37 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2006-10-01 23:45:37 +0400 |
commit | 1ea97e5552bfb9c9845a7cfc5e0a2ce5ecf23cb4 (patch) | |
tree | 8e95ff76c4bd456104fd3501e58cb43e7195d0f2 /source/blender/src/header_ipo.c | |
parent | e5ba49349fdc15e9ea8551e5be88be68879286d8 (diff) |
Patch: [ #5036 ] IPO Curve Mirroring by Joshua Leung (aligorith)
This patch adds the feature of IPO curve mirroring. It mirrors the selected keyframes in the active ipo curves over a user-nominated mirror-line.
Options are:
- Mirror over current frame
- Mirror over vertical axis (X = 0)
- Mirror over horizontal axis (Y = 0)
Functionality can be accessed from:
- Hotkey M in IPO editor
- Submenu in header of IPO editor
Diffstat (limited to 'source/blender/src/header_ipo.c')
-rw-r--r-- | source/blender/src/header_ipo.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/src/header_ipo.c b/source/blender/src/header_ipo.c index 61854556ae8..0a98d10b052 100644 --- a/source/blender/src/header_ipo.c +++ b/source/blender/src/header_ipo.c @@ -316,6 +316,35 @@ static uiBlock *ipo_editmenu_snapmenu(void *arg_unused) return block; } +static void do_ipo_editmenu_mirrormenu(void *arg, int event) +{ + switch(event) { + case 1: /* mirror over current frame */ + case 2: /* mirror over frame 0 */ + case 3: /* mirror over horizontal axis */ + ipo_mirror(event); + break; + } + allqueue(REDRAWVIEW3D, 0); +} + +static uiBlock *ipo_editmenu_mirrormenu(void *arg_unused) +{ + uiBlock *block; + short yco = 20, menuwidth = 120; + + block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_mirrormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); + uiBlockSetButmFunc(block, do_ipo_editmenu_mirrormenu, NULL); + + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Current Frame|M, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Vertical Axis|M, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Horizontal Axis|M, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); + + uiBlockSetDirection(block, UI_RIGHT); + uiTextBoundsBlock(block, 60); + return block; +} + static void do_ipo_editmenu_joinmenu(void *arg, int event) { switch(event) { @@ -573,6 +602,8 @@ static uiBlock *ipo_editmenu(void *arg_unused) uiDefIconTextBlockBut(block, ipo_editmenu_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); + uiDefIconTextBlockBut(block, ipo_editmenu_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, ""); + uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); /*Look to see if any ipos are being edited, so there can be a check next to the menu option*/ |