diff options
author | Joshua Leung <aligorith@gmail.com> | 2014-03-21 17:50:24 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2014-03-21 18:00:27 +0400 |
commit | daccaa713b6e66af4b958fa373b31d557a4caa33 (patch) | |
tree | 9e257e0b6d9e641ab3c9843304c9644ff9ca76ab /source/blender/editors/space_graph/graph_buttons.c | |
parent | 6e99fb04b6cccef4d5685184dfd0d1406fc6e624 (diff) |
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/
Diffstat (limited to 'source/blender/editors/space_graph/graph_buttons.c')
-rw-r--r-- | source/blender/editors/space_graph/graph_buttons.c | 21 |
1 files changed, 20 insertions, 1 deletions
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 |