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>2014-03-21 17:50:24 +0400
committerJoshua Leung <aligorith@gmail.com>2014-03-21 18:00:27 +0400
commitdaccaa713b6e66af4b958fa373b31d557a4caa33 (patch)
tree9e257e0b6d9e641ab3c9843304c9644ff9ca76ab /source/blender/makesdna/DNA_curve_types.h
parent6e99fb04b6cccef4d5685184dfd0d1406fc6e624 (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/makesdna/DNA_curve_types.h')
-rw-r--r--source/blender/makesdna/DNA_curve_types.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index f0c555792fc..ebba59ec785 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -108,10 +108,19 @@ typedef struct BevPoint {
typedef struct BezTriple {
float vec[3][3];
float alfa, weight, radius; /* alfa: tilt in 3D View, weight: used for softbody goal weight, radius: for bevel tapering */
+
short ipo; /* ipo: interpolation mode for segment from this BezTriple to the next */
+
char h1, h2; /* h1, h2: the handle type of the two handles */
char f1, f2, f3; /* f1, f2, f3: used for selection status */
+
char hide; /* hide: used to indicate whether BezTriple is hidden (3D), type of keyframe (eBezTriple_KeyframeTypes) */
+
+ float back; /* BEZT_IPO_BACK */
+ float amplitude, period; /* BEZT_IPO_ELASTIC */
+ char easing; /* easing: easing type for interpolation mode (eBezTriple_Easing) */
+
+ char pad[3];
} BezTriple;
/* note; alfa location in struct is abused by Key system */
@@ -341,11 +350,31 @@ typedef enum eBezTriple_Handle {
/* interpolation modes (used only for BezTriple->ipo) */
typedef enum eBezTriple_Interpolation {
+ /* traditional interpolation */
BEZT_IPO_CONST = 0, /* constant interpolation */
BEZT_IPO_LIN = 1, /* linear interpolation */
- BEZT_IPO_BEZ = 2 /* bezier interpolation */
+ BEZT_IPO_BEZ = 2, /* bezier interpolation */
+
+ /* easing equations */
+ BEZT_IPO_BACK = 3,
+ BEZT_IPO_BOUNCE = 4,
+ BEZT_IPO_CIRC = 5,
+ BEZT_IPO_CUBIC = 6,
+ BEZT_IPO_ELASTIC = 7,
+ BEZT_IPO_EXPO = 8,
+ BEZT_IPO_QUAD = 9,
+ BEZT_IPO_QUART = 10,
+ BEZT_IPO_QUINT = 11,
+ BEZT_IPO_SINE = 12
} eBezTriple_Interpolation;
+/* easing modes (used only for Keyframes - BezTriple->easing) */
+typedef enum eBezTriple_Easing {
+ BEZT_IPO_EASE_IN = 0,
+ BEZT_IPO_EASE_OUT = 1,
+ BEZT_IPO_EASE_IN_OUT = 2
+} eBezTriple_Easing;
+
/* types of keyframe (used only for BezTriple->hide when BezTriple is used in F-Curves) */
typedef enum eBezTriple_KeyframeType {
BEZT_KEYTYPE_KEYFRAME = 0, /* default - 'proper' Keyframe */