Está en la página 1de 3

EXPRESIONES ÚTILES.

Curso de Carlos "Zenzuke" Albarrán


Recursos Adicionales

En este documento, al que hago referencia en el vídeo, os dejo una serie


de expresiones sencillas y útiles que he ido recopilando a lo largo del
tiempo.

AUTO EVOLUCIÓN O AUTO GIRO EN UNA CAPA.


time*grados por segundo

MOVIMIENTO ALEATORIO
wiggle(movimientos por segundo,amplitud);

LOOPS
loopOut(type="cycle", numKeyframes=0)
loopOut(type="pingpong", numKeyframes=0)
loopOut(type="offset", numKeyframes=0)
loopOut(type="continue")
Todos pueden ser loopIn también.

SIMULAR MENOS FOTOGRAMAS POR SEGUNDO


posterizeTime(frames por segundo)

CAPA CON MOVIMIENTO PERFECTAMENTE CIRCULAR


[(thisComp.width/2), (thisComp.height/2)] + [Math.sin(time)*50,
-Math.cos(time)*50]

APLICAR UNA POSICIÓN 3D A UN PARÁMETRO 2D


layer = thisComp.layer("Null 1")
layer.toComp([0,0,0])

COMP TO SURFACE.
L =thisComp.layer("pelo 02");
LCP =L.toComp([0,0,0]);
LLP = thisLayer.fromCompToSurface(LCP);

MANTENER UNA CAPA ENTRE OTRAS DOS.


V1 - Sin emparentar.
(thisComp.layer("capa 1").position + thisComp.layer("capa 2").position)/2
V2 - Emparentadas.
(thisComp.layer("capa 1").toWorld(thisComp.layer("capa
1").anchorPoint)+thisComp.layer("capa 2").toWorld(thisComp.layer("capa
2").anchorPoint))/2

RETRASAR EL MOVIMIENTO DE UNA CAPA CON RESPECTO A SU PADRE.


delay = 1/25; //Retardo del movimiento en frames dividido por los
fotogramas por segundo de la composición
parent.fromWorld(toWorld(anchorPoint,time-delay))

domestika.org
EXPRESIONES ÚTILES.
Curso de Carlos "Zenzuke" Albarrán
Recursos Adicionales

EMPEZAR Y TERMINAR WIGGLE EN DETERMINADOS SEGUNDOS.


timeToStart = 2;
timeToStop = 4;
if ((time > timeToStart) && (time < timeToStop)){
wiggle(3,25);
}else{
value;
}

AUTOFADE
Fade in y Fade Out en una capa, si hay marcadores, los usa para definir
duración.
//Autofade: Añadir a la opacidad
transition = 20; // tiempo de duración de la transición en frames
if (marker.numKeys<2){
tSecs = transition / ( 1 / thisComp.frameDuration); // convertir a
segundos
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 QUE SE REPITE EN LOOP.


freq = 1;
amp = 110;
loopTime = 3;
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);

CAPA 3D INVISIBLE SI NO ESTÁ MIRANDO A CÁMARA.


if (toCompVec([0, 0, 1])[2] > 0 ) value else 0

ANIMAR UN PARÁMETRO DEPENDIENDO DEL VALOR DE BRILLO DE UNA CAPA EXTERNA.


sourceLayer = thisComp.layer("CapaGradiente");
sampleSize = [1,1];
samplePoint = transform.position;
colour= sourceLayer.sampleImage(samplePoint,sampleSize);
x=colour[0]*100;
Si el valor es de dimensión 2, añadir.
[x,x]

EASING DESDE LA POSICIÓN DEL PADRE A LA POSICIÓN ACTUAL.


parentPos=parent.toWorld(parent.anchorPoint)
myposNow=value;
easeplus=easeOut(time,marker.key(1).time,marker.key(2).time, 0, 100);
easeOut(easeplus, 0, 100, parentPos,myposNow);

domestika.org
EXPRESIONES ÚTILES.
Curso de Carlos "Zenzuke" Albarrán
Recursos Adicionales

FORMATEAR UNA VARIABLE PARA MOSTRARLA EN UNA CAJA DE TEXTO.


format(Variable);
function format(a){
if(a instanceof Array){tS="[";for(i in a){tS+=Math.round(a[i])+",
";}tS=tS.substring(0,tS.length-2)+"]\r";}else{tS=Math.round(a);}
return tS;
}

FORMATEAR TEXTO PARA UN CONTADOR DE TIEMPO


x=Math.round(effect("Time")("Slider")).toString();
while (x.length < 2) x = "0" + x;
"12:"+x;

ANIMACIÓN LONGITUD TEXTO TIPO MAQUINA ESCRIBIR.


n=effect("Reveal")("Slider")*length=text.sourceText.length;
showtext=text.sourceText.substr(0,n);

PROMPT ANIMADO CON CURSOR _ PARPADEANTE


n=effect("Reveal")("Slider");
if(Math.round(time*3)%2==0){
showtext=text.sourceText.substr(0,n)+"_";
}
else{
showtext=text.sourceText.substr(0,n);
}

ROTACIÓN DE UNA CAPA CON VELOCIDAD, PARA PODER FRENARLA.


slider = effect("rpm")("Slider");
accum= 0;
f = timeToFrames(inPoint);
while (f < timeToFrames()){
accum+= slider.valueAtTime(framesToTime(f));
f++;
}
accum*thisComp.frameDuration*25;

MANTENER ANCHO DE STROKE AUNQUE ESCALES UNA CAPA DE FORMA.


value / length(toComp([0,0]), toComp([0.7071,0.7071])) || 0.001;

CRÉDITOS
La mayoría de los scripts son de Dan Ebberts de www.motionscript.com
excepto el del ancho de los strokes que es de Adam Plouff y el del prompt
animado que es mío (Carlos Albarrán).

domestika.org

También podría gustarte