
Kinetic Text Expressions for AE
1 year ago
Forgive the content of the text.
The expressions below simply check the velocity of your animations in AE. If you move an objects motion ends abruptly (ie: you didn’t easeIn @ 100%) the physics will kick in automatically. It’s all just that stranger than fiction crap. The paragraph uses text animations (although it’s easy and i could have made it a plugin, it sucks because it’s harder to get words to just appear as opposed to fading in and out with the swings). Anyways, not for paragraphs and the proof is in the video. The code for the rest is below. (Dr Gonzo in the comments below tweaked the code and it seems to work for everybody)
This is code for bouncy position movement.
Just paste it in the position expression field, in this case it will affect x, y and z movements:
// Inertial Easing (elastically reacts to the speed at which it was animated)
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n–;
}
}
if (n == 0){
t = 0;
}else{
t = time – key(n).time;
}
if (n > 0){
v = velocityAtTime(key(n).time – thisComp.frameDuration/10);
amp = .02;
freq = 3.0;
decay = 5.0;
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}
And this is tweaked a bit for rotations… paste it in the x, y or z rotation. It will only affect the ones you place it in:
// Inertial Easing (elastically reacts to the speed at which it was animated)
n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
if (key(n).time > time){
n–;
}
}
if (n == 0) {
t = 0;
} else {
t = time – key(n).time;
}
if (n > 0){
v = velocityAtTime(key(n).time – thisComp.frameDuration/10);
amp = 8;
freq = 2.0;
decay = 3.0;
value + (v/100)*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}
The expressions below simply check the velocity of your animations in AE. If you move an objects motion ends abruptly (ie: you didn’t easeIn @ 100%) the physics will kick in automatically. It’s all just that stranger than fiction crap. The paragraph uses text animations (although it’s easy and i could have made it a plugin, it sucks because it’s harder to get words to just appear as opposed to fading in and out with the swings). Anyways, not for paragraphs and the proof is in the video. The code for the rest is below. (Dr Gonzo in the comments below tweaked the code and it seems to work for everybody)
This is code for bouncy position movement.
Just paste it in the position expression field, in this case it will affect x, y and z movements:
// Inertial Easing (elastically reacts to the speed at which it was animated)
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n–;
}
}
if (n == 0){
t = 0;
}else{
t = time – key(n).time;
}
if (n > 0){
v = velocityAtTime(key(n).time – thisComp.frameDuration/10);
amp = .02;
freq = 3.0;
decay = 5.0;
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}
And this is tweaked a bit for rotations… paste it in the x, y or z rotation. It will only affect the ones you place it in:
// Inertial Easing (elastically reacts to the speed at which it was animated)
n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
if (key(n).time > time){
n–;
}
}
if (n == 0) {
t = 0;
} else {
t = time – key(n).time;
}
if (n > 0){
v = velocityAtTime(key(n).time – thisComp.frameDuration/10);
amp = 8;
freq = 2.0;
decay = 3.0;
value + (v/100)*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}
-
Vimeo: About / Blog / Developers / Jobs /
Community Guidelines /
Help Center / Video School / Music Store / Site Map
/ Vimeo
or
-
Legal: TM + ©2012 Vimeo, LLC. All rights reserved. / Terms of Service / Privacy Statement / Copyright

Prev week
the - was the problem
thanx!
An earlier post says the - may have caused trouble.
I assume it's the "n-".
Maybe you delete the "-" or try "n--"... dunno.
If you open the xpressions with the script editor>debug you can see the lines that give you error with cs4 and earlier version.
has anyone got a definitive answer for this?
Position
// Inertial Bounce (moves settle into place after bouncing around a little)
n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}
}
if (n == 0) {
t = 0;
} else {
t = time - key(n).time;
}
if (n > 0){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
amp = 8;
freq = 2.0;
decay = 3.0;
value + (v/100)*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}
// Inertial Bounce (moves settle into place after bouncing around a little)
n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}
}
if (n == 0) {
t = 0;
} else {
t = time - key(n).time;
}
if (n > 0){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
amp = 8;
freq = 2.0;
decay = 3.0;
value + (v/100)*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}
Once I have the code placed in the right area and have no errors...how do I actually animated it?
Thanks!
move the object to it's end position and add a keyframe.
When you scrub or play it back you will see the code kick in.
It just adds physics to your normal key framing.
Text layer > Animate: Position
Thanks