Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Escala (Círculo)
freq =3;
amplitude = 35;
decay = 1.0;
s = amplitude*Math.sin(freq*time*2*Math.PI)/Math.exp(decay*time);
scale + [s,s]
Escala2:
freq = 5;
amplitude = 25;
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]
Rotación: (péndulo)
freq = 1.0; //oscillations per second
amplitude = 50;
decay = 0; //no decay
amplitude*Math.sin(freq*time*2*Math.PI)/Math.exp(decay*time)
amplitude*Math.sin(freq*time*2*Math.PI)/Math.exp(decay*time)
posCos = Math.abs(Math.cos(freq*time*2*Math.PI));
y = amplitude*posCos/Math.exp(decay*time);
position - [0,y]
Randomizar sólidos:
segMin = .3; //minimum segment duration
segMax = .7; //maximum segment duration
minVal = 0;
maxVal = thisComp.width;
end = 0;
j = 0;
while ( time >= end){
j += 1;
seedRandom(j,true);
start = end;
end += random(segMin,segMax);
}
endVal = random(minVal,maxVal);
seedRandom(j-1,true);
dummy=random(); //this is a throw-away value
startVal = random(minVal,maxVal);
y = position[1];
ease(time,start,end,[startVal,y],[endVal,y])
En la capa en la que tenemos las claves, seleccionamos el parámetro que hemos animado en
la linea de tiempo (Posición, Escala, Rotación, Remapeo de tiempo.... etc), y con él
seleccionado, vamos al menú Animación / Agregar Expresión [ Alt + Shift + + (tecla "+" del
teclado normal, no del numérico)], esto nos abrirá un cuadro de texto junto al parámetro
seleccionado en la línea de tiempo, donde introduciremos una de estas expresiones:
loop_out("cycle",0)
loop_out("pingpong",0)
loop_out("offset",0)
loop_out("continue")
Ha de introducirse la expresión en cada valor que queremos que repita en loop. Pudiendo
controlar individualmente cada uno de ellos.
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
Observaciones!
Donde g=5000; esta es la gravedad que tendrá el rebote, puedes moverla de acuerdo a tus composiciones.
Ahora nMax=9; Es el numero de rebotes que le daremos, esta cuenta despues del primer rebote, osease que si son 9,
se le añade 1 más y el total son 10 rebotes, igual modificala a tu composición.[/justify]
Nota: Recuerda solo mover los números, y recuerda que al finalizar el número tiene que tener el punto y coma
ejemplo g=7000; (No olvides poner esto al final del número ";" )
FADE O DESVANECIMIENTO
La expresión de desvanecimiento automático es útil cuando no desea molestarse en crear
fotogramas clave para una animación de desvanecimiento. De forma automática creará un
fundido en el inicio y en el final del clip.
transition = 20; // Duración en frames del desvanecimiento
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)
}
_________
WIGGLE
Esta expresión sirve para agitar o menear aleatoriamente cualquier valor de una propiedad.
Dentro incluye dos valores, el primero es la velocidad de la variación que va a realizar y el
segundo es la magnitud de esa variación.
Si lo aplicamos a la posición pondriamos wiggle(A,B) siendo A la velocidad con la que se va a
mover y B la cantidad de pixeles que se moverá como máximo. Si lo aplicamos a la rotación el
valor A sería la velocidad con la que va rotar y B la variación máxima en grados que va a rotar.
wiggle(5,10)
_________
TIME
Esta expresión hace que cualquier valor aumente mientras avanza el tiempo, podemos
multiplicar la velocidad añadiendo un * seguido del número por el que lo querramos multiplicar.
Si utilizamos un valor negativo la expresión funcionaria ensentido contrario, por ejemplo
«time*-100».
time*100
_________
INDEX
El index el número de una capa, si tenemos una sola capa esa capa tendría el valor de index de
1, si tenemos dos capas una sería index 1 y otra index 2. Podemos utilizar esta expresión en
After Effects para que cuando dupliquemos una capa varias veces esta varia algo de su
comportamiento en función del index. Por ejemplo la posición, rotación,etc.
index*360/20
_________
MOTION TRAIL
Un interesante efecto que podemos aplicar al movimiento. Tendremos que aplicar un código a la
opacidad y otro a la posición. Luego de poner los códigos duplicamos la capa la cantidad de
veces que queramos que se genere la repetición del efecto.
//Aplicar a la posición
delay = 3; //number of frames to delay
d = delay*thisComp.frameDuration*(index - 1);
thisComp.layer(1).position.valueAtTime(time - d)
//Aplicar a la opacidad
opacityFactor = .75;
Math.pow(opacityFactor,index - 1)*100
_________
BLINK (PARPADEO)
Se aplica en la opacidad para generar el efecto de parpadeo, podemos variar la velocidad con la
que nuestra capa va a aparecer y desaparecer cambiando el número de la primera línea.
blinkSpeed=15; // velocidad del parpadeo
n= Math.sin(time*blinkSpeed);
if(n<0) 0 else 100;
_________
SUAVIZAR
Muy útil cuando hemos animado algo con fotogramas claves y queremos que el movimiento sea
suavizado.
smooth(width = .2, samples = 5, t = time)
https://samueltroconis.com/las-10-mejores-expresiones-en-after-effects/
Overshoot Expresión:
freq = 3;
decay = 5;
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time) n--;
}
if (n > 0){
t = time - key(n).time;
amp = velocityAtTime(key(n).time - .001);
w = freq*Math.PI*2;
value + amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
}else
value
http://www.jjgifford.com/expressions/reference/index.html
amp = .1;
freq = 2.0;
decay = 2.0;
n = 0;
time_max = 4;
n = nearestKey(time).index;
}}
if (n == 0){ t = 0;
}else{
t = time - key(n).time;
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{value}
Autofade
This is nothing brilliant, but it is something I wrote and use all the time. You’ll also find
something similar in the After Effects preset “Behaviors” called Fade In + Out, which uses the
Solid Composite effect and a custom interface. But, I like a simpler version that I use on
Opacity. This is a slightly enhanced version that I’d revamped since I posted it in the “Auto
Slideshow” presets and added the option to use markers. If there are no markers, the
transition variable is used (where is says “transition=20″, this is in frames.) If there are *2*
markers, the first marker is used for end point of the fade in, and the second marker is used to
define the start of the fade out.
if (marker.numKeys<2){
linear(time, inPoint, inPoint + tSecs, 0, 100) - linear(time, outPoint - tSecs, outPoint, 0, 100)
}else{
}
Snap Zoom In/Out
This is a cool expression to use on text. It creates a “snap” zoom on the in and out of the layer
by modifying scale.
If you prefer to use Z space position instead of scale, try this one:
Y Axis Jitter
This is from Lesson 5 of my expressions series. This creates a random jittery motion in the Y
axis. You can modify probability to make or less jitter, and the pos variable to define how large
the jitter is.
// Y Axis Jitter
pos = 50;
val = random(-probability-2, 1);
m = clamp(val, 0, 1);
y = wiggle(10, pos*m)-position;
5 . toComp
This one you’ll have to watch a short tutorial for here, and you can read a lot more about it at
motionscript.com. The idea is that you can apply the equivalent 3D location to any 2D location.
This might not sound exciting. But, think of all the 2D parameters out there, like lens flare
location, Shine source, beams, etc. It is probably my most commonly used expression. But, the
basic idea is this:
layer.toComp([0,0,0])
Note: I intentionally left off the semicolon, as you technically don’t need it in this case.
Therefore, all you need to do is pickwhip your layer where the “layer =” variable is.
REBOTe:
// Inertial
Bounce - Created
by Animoplex:
www.animoplex.com
// Original Version: http://www.graymachine.com/top-5-effects-expressions/
// Modified expression for a smoother bounce effect and easier editing. Use
this on any property with two keyframes to get a nice bounce effect that is
based on velocity of the value change. Perfect for a scale from 0 to 100 or
a speedy rotation that needs some extra life. Adjust amp, freq and decay
values to tweak the effect. Amp is intensity, freq is bounces per second,
and decay is the speed of decay, slow to fast.
// Full Tutorial: https://www.youtube.com/watch?v=653lxeVIyoo
amp = 5.0; freq = 2.0; decay = 4.0;
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/100)*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
} else {
value;
}