Page 1 of 1

blink layers

Posted: June 15th, 2004, 2:11 pm
by ig88
this is a script that i created and then was refined by good ol' dan ebberts to make it correct.

it is used to make layers blink in and out automatically tracking with their in and out points.

the keyframes for opacity will look like this:
0,20,0,40,0,60,0,80,0,100 and reverse for the out.

the script:

// blinks in with 5 blinks

blinks = 5; // The number of times to blink while fading in. you can change this and it will recompute for you

blinkFrames = blinks*2;
inFrame = Math.round(in_point/this_comp.frame_duration);
outFrame = Math.round(out_point/this_comp.frame_duration);
frame = Math.round(time/this_comp.frame_duration);

if (frame < inFrame + blinkFrames){
delta = frame - inFrame;
if (delta % 2 == 0){
0;
} else {
linear(delta,0,blinkFrames,10,110);
}
} else if (frame < outFrame - blinkFrames){
100;
} else {
delta = frame - (outFrame - blinkFrames);
if (delta % 2 != 0){
0;
} else {
linear(delta,0,blinkFrames,100,0);
}
}