Page 1 of 1

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

PostPosted: 06/4/2009, 9:02 am
by FunkNotPunk
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.

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

PostPosted: 06/4/2009, 9:14 am
by mjt57
// 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);

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

PostPosted: 06/4/2009, 9:37 am
by FunkNotPunk
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!

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

PostPosted: 06/4/2009, 10:08 am
by mjt57
Glad I could help.