Need Help Fast - Ease and Wizz - I need script...

Scripting for After Effects

Need Help Fast - Ease and Wizz - I need script...

Postby FunkNotPunk on 06/4/2009, 9:02 am

Question / Request first, explanation second... can some please, please, please post the code for the Ease and Wizz "Back" expression, set to do "In and Out" for "all keyframes"? I would be eternally greatful.

The reason I need the actual script is that I just upgraded to CS4 a couple of days ago, and I've got After Effects projects created in CS3 containing Ease and Wizz expressions which I opened for the first time this morning, they are all broken now.

Where I am, I cannot access the Ease and Wizz site to download it again (government computer), and I have to finish this project today. If someone sends me the script, I can manually put it in the Composition and finish, then download the whole thing tonight when I get home.

If anyone can help me, I would be eternally grateful.
FunkNotPunk
 
Posts: 34
Joined: 08/8/2008, 12:05 pm

Re: Need Help Fast - Ease and Wizz - I need script...

Postby mjt57 on 06/4/2009, 9:14 am

// Ease and Wizz 2.0 : inBack : All keyframes
// Ian Haigh (http://ianhaigh.com/easeandwizz/)
// Last built: 2009-01-08T11:11:55+11:00

// some defaults
var p = 0.8; // period for elastic
var a = 50; // amplitude for elastic
var s = 1.70158; // overshoot amount for "back"

function inBack(t, b, c, d, a, p) {
if (s == null) s = 1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
}

function easeAndWizz() {

var n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
if (key(n).time > time) { n-- }
}

try {
var key1 = key(n);
var key2 = key(n+1);
} catch(e) {
return null;
}

// determine how many dimensions the keyframes need
var dim = 1; // It's gotta have at least ONE dimension
try {
key(1)[1];
dim = 2;
key(1)[2];
dim = 3;
} catch(e) {}

t = time - key1.time;
d = key2.time - key1.time;

sX = key1[0];
eX = key2[0] - key1[0];

if (dim >= 2) {
sY = key1[1];
eY = key2[1] - key1[1];

if (dim >= 3) {
sZ = key1[2];
eZ = key2[2] - key1[2];
}
}

if ((time < key1.time) || (time > key2.time)) {
return value;
} else {
val1 = inBack(t, sX, eX, d, a, p, s);
switch (dim) {
case 1:
return val1;
break;
case 2:
val2 = inBack(t, sY, eY, d, a, p, s);
return [val1, val2];
break;
case 3:
val2 = inBack(t, sY, eY, d, a, p, s);
val3 = inBack(t, sZ, eZ, d, a, p, s);
return [val1, val2, val3];
break;
default:
return null;
}
}
}

(easeAndWizz() || value);
Attachments
ease-and-wizz-2.0.zip
(253.62 KiB) Downloaded 4262 times
mjt57
 
Posts: 588
Joined: 08/14/2008, 9:13 am
Location: Kansas City

Re: Need Help Fast - Ease and Wizz - I need script...

Postby FunkNotPunk on 06/4/2009, 9:37 am

Hey mjt57 ,

Thanks for the script and thanks more for the 2.0 .zip file. The only reason I didn't ask for that to begin with is that our network is extremely restrictive and you never know what hosts it will allow you to access or not... but it let me get your's and download the file, so thanks again!
FunkNotPunk
 
Posts: 34
Joined: 08/8/2008, 12:05 pm

Re: Need Help Fast - Ease and Wizz - I need script...

Postby mjt57 on 06/4/2009, 10:08 am

Glad I could help.
mjt57
 
Posts: 588
Joined: 08/14/2008, 9:13 am
Location: Kansas City


Return to After Effects Expressions