From daccaa713b6e66af4b958fa373b31d557a4caa33 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 22 Mar 2014 02:50:24 +1300 Subject: Patch T22084: Robert Penner Easing Equations for FCurves This commit introduces support for a number of new interpolation types which are useful for motion-graphics work. These define a number of "easing equations" (basically, equations which define some preset ways that one keyframe transitions to another) which reduce the amount of manual work (inserting and tweaking keyframes) to achieve certain common effects. For example, snappy movements, and fake-physics such as bouncing/springing effects. The additional interpolation types introduced in this commit can be found in many packages and toolkits (notably Qt and all modern web browsers). For more info and a few live demos, see [1] and [2]. Credits: * Dan Eicher (dna) - Original patch * Thomas Beck (plasmasolutions) - Porting/updating patch to 2.70 codebase * Joshua Leung (aligorith) - Code review and a few polishing tweaks Additional Resources: [1] http://easings.net [2] http://www.robertpenner.com/easing/ --- source/blender/editors/space_graph/graph_buttons.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_graph/graph_buttons.c') diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 42aa9935251..671a4c3afd3 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -291,7 +291,26 @@ static void graph_panel_key_properties(const bContext *C, Panel *pa) /* interpolation */ col = uiLayoutColumn(layout, FALSE); uiItemR(col, &bezt_ptr, "interpolation", 0, NULL, ICON_NONE); - + + /* easing type */ + if (bezt->ipo > BEZT_IPO_BEZ) + uiItemR(col, &bezt_ptr, "easing", 0, NULL, 0); + + /* easing extra */ + switch (bezt->ipo) { + case BEZT_IPO_BACK: + col = uiLayoutColumn(layout, 1); + uiItemR(col, &bezt_ptr, "back", 0, NULL, 0); + break; + case BEZT_IPO_ELASTIC: + col = uiLayoutColumn(layout, 1); + uiItemR(col, &bezt_ptr, "amplitude", 0, NULL, 0); + uiItemR(col, &bezt_ptr, "period", 0, NULL, 0); + break; + default: + break; + } + /* numerical coordinate editing * - we use the button-versions of the calls so that we can attach special update handlers * and unit conversion magic that cannot be achieved using a purely RNA-approach -- cgit v1.2.3