Professional Documents
Culture Documents
Expressões Do After Effect
Expressões Do After Effect
Qualquer coisa só me avisar que eu corrijo:
@gabrielfelix.me
Gabriel Felix• Motion Designer (@gabrielfelix.me) • Instagram photos and videos
01. LoopOut
loopOut("cycle")
loopOut("pingpong")
loopOut("offset")
02. LoopIn
loopIn("cycle")
loopIn("pingpong")
loopIn("offset")
03. Wiggle
wiggle(2,50)
w = wiggle(2,50);
[w[0],value[1]]
w = wiggle(2,50);
[w[1],value[0]]
f = 5;
a = 10;
posterizeTime(f);
wiggle(f, a);
fps=5; //frequency
amount=25; //amplitude
wiggle(fps,amount,octaves = 1, amp_mult = 0.5,(Math.round(time*fps))/fps);
wiggle(1,200,1,1,time)
freq = 1;
amp = 110;
loopTime = 5;
t = time % loopTime;
wiggle1 = wiggle(freq, amp, 1, 0.5, t);
wiggle2 = wiggle(freq, amp, 1, 0.5, t - loopTime);
linear(t, 0, loopTime, wiggle1, wiggle2)
07. Maintain Scale
s = [];
ps = parent.transform.scale.value;
for (i = 0; i < ps.length; i++){
s[i] = value[i]*100/ps[i];
}
s
thisComp.name
09. Overshoot
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;}
value + (v/100)*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);}else{value;}
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 && t < 1){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{value}
10. Bounce
e = .7;
g = 5000;
nMax = 9;
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time) n--;
}
if (n > 0){
t = time - key(n).time;
v = -velocityAtTime(key(n).time - .001)*e;
vl = length(v);
if (value instanceof Array){
vu = (vl > 0) ? normalize(v) : [0,0,0];
}else{
vu = (v < 0) ? -1 : 1;
}
tCur = 0;
segDur = 2*vl/g;
tNext = segDur;
nb = 1; // number of bounces
while (tNext < t && nb <= nMax){
vl *= e;
segDur *= e;
tCur = tNext;
tNext += segDur;
nb++
}
if(nb <= nMax){
delta = t - tCur;
value + vu*delta*(vl - g*delta/2);
}else{
value
}
}else
value
11. Fade
transition = 10;
if (marker.numKeys<2){
tSecs = transition / ( 1 / thisComp.frameDuration);
linear(time, inPoint, inPoint + tSecs, 0, 100)
- linear(time, outPoint - tSecs, outPoint, 0, 100)
}else{
linear(time, inPoint, marker.key(1).time, 0, 100)
- linear(time, marker.key(2).time, outPoint, 0, 100)
}
12. Blink
blinkSpeed=15;
n= Math.sin(time*blinkSpeed);
if(n<0) 0 else 100;
s=Math.exp((time-inPoint)*2);
[s,s]+value;
14. Type
cursor = "|";
blinkTime = 1;
charMod = 1;
num = effect("Slider Control")("Slider");
toggle = effect("Checkbox Control")("Checkbox");
if (toggle == 1) {
t = ((time - inPoint) / blinkTime) % 1;
if (num.numKeys > 2) {n = 0} else {n = 1}
ux = Math.abs(num.speedAtTime(time + thisComp.frameDuration*n));
blink = Math.round(ux + t);
if (blink == 0) {
cursor = " ";
}
} else {
cursor = " ";
}
if (charMod == 0) {
textAnim = num * text.sourceText.length / 100;
} else {
textAnim = num;
}
X = 2;
amp = 100;
Math.sin(time * X ) * amp ;
16. Delay
delay = .5;
try{
parent.fromWorld(toWorld(anchorPoint,time-delay));
}catch(err){
value;
}
try{
timeStart = thisProperty.key(1).time;
duration = thisProperty.key(thisProperty.numKeys).time-timeStart;
pingPong =true; //change to true value if you want to loop animationn back & forth
quant=Math.floor((time-timeStart)/duration);
if(quant<0) quant = 0
if(quant%2 == 1 && pingPong == true){ t = 2*timeStart+ (quant+1)*duration - time;
}
else{
t = time-quant*duration;
}
}
catch(err){
t = time;
}
thisProperty.valueAtTime(t)
18. Elastic
// some defaults
var p = 0.6; // period for elastic
var a = 140; // amplitude for elastic
var s = 1.70158; // overshoot amount for "back"
function outElastic(t, b, c, d, a, p) {
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (!a || a < Math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*Math.PI) * Math.asin
(c/a); return (a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + 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;
}
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];
}
}
(easeAndWizz() || value);
freq = 2;
amplitude = 40;
decay = 1.0;
t = time - inPoint;
x = scale[0] + amplitude*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
y = (1/x)*10000;
[x,y]
20. Wave
22. Exato
Math.floor()
23. Maintain Stroke Width