After Effects - Snippets (Expressions)

Aus Wikizone
Version vom 20. Juli 2012, 06:49 Uhr von 149.172.152.49 (Diskussion) (→‎Links)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

Quickstart[Bearbeiten]

Zum automatisieren bieten sich in After Effects die sogenannten Expressions an. Damit lassen sich Vorgänge die mit mehreren Keyframes realisiert werden automatisieren. Man wendet eine Expression z.B. auf die Opacity Eigenschaft eines Clips an um ihn automatisch ohne Keyframes zu setzen Ein- und Auszublenden.

Links[Bearbeiten]

Einige der Expressions sind von folgenden Seiten

http://www.graymachine.com/2010/04/my-top-expressions/ (Zugriff 7/2012)

Hat auch schöne Tutorials unter

http://www.graymachine.com/tutorials/

Expression Snippets[Bearbeiten]

Autofade (Clip Fade In - Fade Out)[Bearbeiten]

Blendet einen Clip mit einer bestimmten Anzahl von Frames ein und aus

fadeTime = 12;
opacityMin = 0;
opacityMax = 100;
layerDuration = outPoint - inPoint;
singleFrame = thisComp.frameDuration;

animateIn = linear(time, inPoint, (inPoint + framesToTime(fadeTime)), opacityMin, opacityMax);
animateOut = linear(time, (outPoint - framesToTime(fadeTime+1)), (outPoint-singleFrame), opacityMax, opacityMin);

if(time < (layerDuration/2+inPoint)){
    animateIn;
}else{
animateOut;
}

Autofade 2 (Marker Version)[Bearbeiten]

Diese Version kann Markers nutzen um den Fade In und Fade Out Punkt zu bestimmen.

//Autofade: Add to opacity

transition = 20;       // transition time in frames
if (marker.numKeys<2){
tSecs = transition / ( 1 / thisComp.frameDuration); // convert to seconds
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)
}

Intertial Bounce[Bearbeiten]

Bouncing Bewegung auf alle möglichen Bewegungen anwendbar. Passt gut zu Text

amp = .1;
freq = 2.0;
decay = 2.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){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{value}

Snap Zoom In/Out[Bearbeiten]

//Snap zoom in and out: apply to scale
snapScale = 300; //percent of scale to zoom

trans = 4; //  transition time in frames
trans = trans * thisComp.frameDuration;
inTrans  = easeOut(time, inPoint, inPoint + trans, [snapScale,snapScale], [0,0]);
outTrans = easeIn(time, outPoint, outPoint - trans, [0,0], [snapScale, snapScale]);
value+ inTrans + outTrans

Snap Zoom z-position[Bearbeiten]

zoom = 5000; //distance to zoom
trans = 4; //  transition time in frames
trans = trans * thisComp.frameDuration;

inTrans  = easeIn(time, inPoint, inPoint + trans, [0,0,zoom], [0,0,0]);
outTrans = easeOut(time, outPoint, outPoint - trans*2, [0,0,0], [0,0,zoom]);
value+ inTrans - outTrans

Y Axis Jitter[Bearbeiten]

// Y Axis Jitter
probability = 8 ;  //higher is less likely
pos = 50;

val  = random(-probability-2, 1);
m = clamp(val, 0, 1);
y = wiggle(10, pos*m)-position;
value + [0, y[1]]