From 0346ed80bd510c34f40bd0e2d36a5cd5a350a51a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 15 Apr 2008 14:34:57 +0000 Subject: added a E as a key shortcut to IPO Extend Mode --- source/blender/include/BSE_editipo.h | 1 + source/blender/src/editipo_mods.c | 21 +++++++++++++++++++++ source/blender/src/header_ipo.c | 8 ++++---- source/blender/src/space.c | 4 ++++ 4 files changed, 30 insertions(+), 4 deletions(-) (limited to 'source/blender') diff --git a/source/blender/include/BSE_editipo.h b/source/blender/include/BSE_editipo.h index 99a7930ddb1..46c72f2747a 100644 --- a/source/blender/include/BSE_editipo.h +++ b/source/blender/include/BSE_editipo.h @@ -113,6 +113,7 @@ void sethandles_ipo(int code); void select_ipo_bezier_keys(struct Ipo *ipo, int selectmode); void select_icu_bezier_keys(struct IpoCurve *icu, int selectmode); void set_ipotype(void); +void set_ipoextend(void); void borderselect_ipo(void); void del_ipo(int need_check); void del_ipoCurve ( struct IpoCurve * icu ); diff --git a/source/blender/src/editipo_mods.c b/source/blender/src/editipo_mods.c index ae283ce8c0b..e8caa936985 100644 --- a/source/blender/src/editipo_mods.c +++ b/source/blender/src/editipo_mods.c @@ -969,6 +969,27 @@ void set_ipotype(void) scrarea_queue_winredraw(curarea); } +void set_ipoextend(void) +{ + short event= pupmenu("Ipo Extend Mode %t|Constant %x1|Extrapolation %x2|Cyclic %x3|Cyclic Extrapolation %x4"); + + switch(event) + { + case 0: + set_exprap_ipo(IPO_HORIZ); + break; + case 1: + set_exprap_ipo(IPO_DIR); + break; + case 2: + set_exprap_ipo(IPO_CYCL); + break; + case 3: + set_exprap_ipo(IPO_CYCLX); + break; + } +} + void borderselect_ipo(void) { EditIpo *ei; diff --git a/source/blender/src/header_ipo.c b/source/blender/src/header_ipo.c index 9770d2a5866..b7a3bfba541 100644 --- a/source/blender/src/header_ipo.c +++ b/source/blender/src/header_ipo.c @@ -567,10 +567,10 @@ static uiBlock *ipo_editmenu_extendmenu(void *arg_unused) block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_extendmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin); uiBlockSetButmFunc(block, do_ipo_editmenu_extendmenu, NULL); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Constant", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrapolation", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cyclic", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cyclic Extrapolation", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Constant|E, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Extrapolation|E, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cyclic|E, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cyclic Extrapolation|E, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); uiBlockSetDirection(block, UI_RIGHT); uiTextBoundsBlock(block, 60); diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 546a171c458..4abdc04dbd4 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -3133,6 +3133,10 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt) if (G.qual==0) set_ipotype(); break; + case EKEY: + if (G.qual==0) + set_ipoextend(); + break; case VKEY: if (G.qual==0) sethandles_ipo(HD_VECT); -- cgit v1.2.3