After Effects - Snippets (Expressions): Unterschied zwischen den Versionen
Aus Wikizone
(Die Seite wurde neu angelegt: „ == Quickstart == Zum automatisieren bieten sich in After Effects die sogenannten Expressions an. Damit lassen sich Vorgänge die mit mehreren Keyframes realisie…“) |
|||
| Zeile 26: | Zeile 26: | ||
}else{ | }else{ | ||
animateOut; | animateOut; | ||
| + | } | ||
| + | </pre> | ||
| + | |||
| + | === Autofade 2 (Marker Version) === | ||
| + | Diese Version kann Markers nutzen um den Fade In und Fade Out Punkt zu bestimmen. | ||
| + | <pre> | ||
| + | //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) | ||
} | } | ||
</pre> | </pre> | ||
Version vom 20. Juli 2012, 06:45 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}