After Effects - Snippets (Expressions): Unterschied zwischen den Versionen
Aus Wikizone
| Zeile 66: | Zeile 66: | ||
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t); | value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t); | ||
}else{value} | }else{value} | ||
| + | </pre> | ||
| + | |||
| + | === Snap Zoom In/Out === | ||
| + | <pre> | ||
| + | //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 | ||
| + | </pre> | ||
| + | === Snap Zoom z-position === | ||
| + | <pre> | ||
| + | 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 | ||
| + | </pre> | ||
| + | |||
| + | === Y Axis Jitter === | ||
| + | <pre> | ||
| + | // 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]] | ||
</pre> | </pre> | ||
Version vom 20. Juli 2012, 06:48 Uhr
Quickstart
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
Einige der Expressions sind von folgenden Seiten
http://www.graymachine.com/2010/04/my-top-expressions/ (Zugriff 7/2012)
Expression Snippets
Autofade (Clip Fade In - Fade Out)
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)
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
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
//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
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
// 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]]