Professional Documents
Culture Documents
Formatted: Strikethrough
IF YOU WANT TO ADD
oi
EXPRESSIONS, DO IT AT
THE BOTTOM OF THE
DOCUMENT
Inertial Bounce iInertial Bouns like making your moves "rubbery." Layers will Formatted: Strikethrough
overextend, then settle into place on position and rotation keyframes.
Formatted: Strikethrough
// Inertial Bounce (moves settle into place after bouncing around a little)
Formatted: Strikethrough
cccccc amp = .1;
freq = 2.0; Formatted: Space After: 0 pt, Line spacing: Multiple
decay = 2.0; 1.15 li
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}}
if (n == 0){ t = 0;
}else{sdadaasd
t = time - key(n).timevbvf;
}
if (n > 0 && t < 1){
v = velocityA 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{sdadaasd
tTime(key(n).time - thisComp.frameDuration/10);
value + v*amp*Math.sin(freq*t*2*
4Math.PI)/Math.exp(decay*t); }else{value} Formatted: Strikethrough
//Takes 2D position (not world space) and uses it to position 3D objects in screen Formatted: Strikethrough
le Formatted: Strikethrough
3Jumpy Wiggle 1 makes wiggle skip and hold rather than move fluidly. Formatted: Strikethrough
Formatted: Strikethrough
Jumpy Wiggle 2 is similar to 1, but works at a defined FPS so your "jump" will happen Formatted: Strikethrough
at a regular pace.
Sometimes you just want something to move constantly without keyframing it. Use Formatted: Strikethrough
throw.
3D layer invisible while facing backwards to camera (use on Opacity): Formatted: Strikethrough
if (toCompVec([0, 0, 1])[2] > 0 ) value else 0
Formatted: Strikethrough
Parent Puppet pin to Null (there is a script on AEscripts for this also I believe, haven't Formatted: Strikethrough
used it):
n=thisComp.layer("NullObject_Name"); Formatted: Strikethrough
nullpos=n.toComp(n.anchorPoint); Formatted: Strikethrough
fromComp(nullpos);
Formatted: Strikethrough
Numbers: Formatted: Strikethrough
Add a slider and name to 'Value'
Formatted: Strikethrough
OR Formatted: Strikethrough
thisComp.layer(index+1).transform.position.valueAtTime(time-.1);oeqydz2K16
Formatted: Strikethrough
Formatted: Strikethrough
//Copy rotation from layer below and rotate 22.5 Formatted: Strikethrough
thisComp.layer(index+1).transform.rotation+22.5;
Formatted: Strikethrough
Lock a layer to the exact centre of the comp (very useful for rotoscoping where you Formatted: Strikethrough
accidentally nudge the layer all the time)
Formatted: Strikethrough
//On the (2D, comp size) layer’s Position:
Formatted: Strikethrough
[comp.Length/2, comp.Height/2];
Formatted: Strikethrough
DEFINITION Formatted: Strikethrough
Formatted: Space Before: 24 pt, After: 6 pt, Line
spacing: Multiple 1.15 li
Google Docs
Formatted: Right: 0", Space After: 0 pt
Formatted: Strikethrough
Formatted: Space After: 0 pt, Line spacing: Multiple
1.15 li
Formatted: Strikethrough
Posted by: Margaret Rouse
WhatIs.com Formatted: Strikethrough
Formatted: Space Before: 0 pt, After: 0 pt
Formatted: Strikethrough
Formatted: Strikethrough
Time delay from layer above
Formatted: Strikethrough
thisComp.layer(index+1)t.transform.position.valueAtTime(time-.1)
Formatted: Left, Indent: Hanging: 0.25", Outline
Wiggle in one direction only numbered + Level: 1 + Numbering Style: Bullet +
Wiggle Y Only: Aligned at: 0.75" + Indent at: 0.5"
Formatted: Strikethrough
[value[0],wiggle(1,100)[1]]
Formatted: Strikethrough
For when you want burn in text to automatically display the layer name (i.e. render out Formatted: Strikethrough
tiff sequence first, then making a QT w/ name burn in).
function pad(number, length) { var str = '' + number; while (str.length < length) { str = '0' + str; Formatted: Strikethrough
} return str; } var theLayerName = thisComp.layer(index+1).name; var theLayerNameSplit =
theLayerName.split('.'); theLayerNameSplit[0];
To change which layer is read for the name, change the (index+1) to (index+2) and so on. Formatted: Strikethrough
Use Expression Control angles or sliders for “ from”, “to”, and an Expression Formatted: Strikethrough
Control slider assigned to “period” for fine control. You can apply these to any layer.
Formatted: Strikethrough
Change “linear” to “ease” for smoother interpolation.
by Michael Natkin & Brian Maffitt Formatted: Strikethrough
Formatted: Strikethrough
Formatted: Strikethrough
from = -45; //one end of your oscillation
to = 45; //the other end of your oscillation Formatted: Strikethrough
period = 1.5; //time between oscillation points (multiply by 2 for a round trip) Formatted: Strikethrough
t = time % (period * 2);
Formatted: Strikethrough
if (t > period) t = 2 * period - t;
linear(t, 0, period, from, to) Formatted: Strikethrough
Formatted: Strikethrough
Formatted: No widow/orphan control
Grayscale Value to x,y Data
(x&y outputs will range from 0-100) Formatted: Strikethrough
Formatted: Strikethrough
Formatted ...
sourceLayer = thisComp.layer(“layer");
sampleSize = [1,1]; Formatted ...
samplePoint = transform.position; Formatted ...
color= sourceLayer.sampleImage(samplePoint,sampleSize);
Formatted ...
x=color[0]*100
y=color[0]*100 Formatted ...
[x,y] Formatted ...
Formatted ...
Center the Anchor Point in a text layer - automatically adjusts with changes Formatted: Strikethrough
Offset one axis separately for linked comps in 3D space Formatted ...
Formatted ...
thePos = comp("MainComp").layer("Your3DLayer").transform.position; Formatted ...
[thePos[0]+offset, thePos[1]+offset, thePos[2]+offset]
//NUMBER COUNTDOWN SCRIPT (WITH COMMAS) Formatted ...
To get a number to countdown (from say 256,000 to 152,000 with commas, no decimal) Formatted ...
follow these steps. (I didn't write most of the expression, got it from a website but it works Formatted ...
great)
Formatted ...
1. Create a expression control slider and use the slider control effect to animate number. Formatted ...
Enter the actual value instead of using the slider for numbers larger than one hundred. Formatted ...
Simply key frame the effect and use the character editor to format the text. (Goes as high as
Formatted ...
1,000,000)
Formatted ...
Right-click on an Expression Slider>Edit Value to set the minimum and maximum it Formatted ...
can slide to
Formatted ...
For higher numbers i.e billions just add in a multiply value after the first line:
var num = effect("Slider Control")("Slider") * 10000000 Formatted ...
Formatted ...
Expression:
Formatted ...
a = 0; Formatted: Strikethrough
b = 500; Formatted: Strikethrough
dur = 2;
Formatted: Strikethrough
tension = 5;
Formatted: Strikethrough
Anyone wanna start a Wiki for this? Seems too useful not to... Formatted: Strikethrough
IMPACT BOUNCE (bounce back after impact, like slamming doors, Formatted: Strikethrough
bouncing ball) You can apply it to Position, but it will work with any key-
Formatted ...
Formatted ...
Formatted ...
Formatted ...
framed parameters (scale, opacity etc) Formatted ...
Formatted ...
0e = .7;
g = 5000; Formatted ...
nMax = 9; Formatted ...
n = 0;
if (numKeys > 0){ Formatted ...
n = nearestKey(time).index;
if (key(n).time > time) n--;
Formatted ...
} Formatted ...
if (n > 0){
t = time - key(n).time; Formatted ...
v = -velocityAtTime(key(n).time - .001)*e;
Formatted ...
vl = length(v);
if (value instanceof Array){ Formatted ...
vu = (vl > 0) ? normalize(v) : [0,0,0];
}else{ Formatted ...
vu = (v < 0) ? -1 : 1;
Formatted ...
}
tCur = 0; Formatted ...
segDur = 2*vl/g;
tNext = segDur; Formatted ...
nb = 1; // number of bounces Formatted ...
while (tNext < t && nb <= nMax){
vl *= e; Formatted ...
segDur *= e;
tCur = tNext; Formatted ...
tNext += segDur; Formatted ...
nb++
} Formatted ...
if(nb <= nMax){
delta = t - tCur;
Formatted ...
value + vu*delta*(vl - g*delta/2); Formatted ...
}else{
value Formatted ...
}
Formatted ...
}else
value Formatted ...
Formatted ...
Formatted ...
Adjust a single value (parameter) of an effect on a layer, the Formatted ...
further away the layer is from the camera. For this example, it Formatted ...
Links position value of effects (corner pin, beam etc etc) to postion of Null Formatted: Strikethrough
(or any layer be it 2d or 3d) Formatted: Space After: 0 pt
Apply this to position value in Effect: Formatted: Strikethrough
target = thisComp.layer("Layer"); // Layer is the layer your want to get the position
Formatted: Strikethrough
value from
fromComp(target.toComp(target.anchorPoint)); Formatted: Strikethrough
if (n == 0){
value;
} else {
max_dev=20; // max deviation in pixels
spd=35; //speed of oscillation
decay=10; //how fast it slows down
t = time - marker.key(n).time;
s = max_dev*Math.sin(spd*(t))/Math.exp(decay*t);
value + [s,s];
}
So wherever you place a marker you'll get the old squish and squash. Hit the asterisk (*) key on the Formatted: Strikethrough
numeric pad to drop a marker wherever you are on the timeline.
Formatted: Strikethrough
Note: No marker, no squish and squash. Five markers give five squish and squashes.
Also if you're talking a diferent expression, just drop that in below the }else{. Formatted: Strikethrough
by Mike Clasby (yikesmikes)
Formatted: Strikethrough
Formatted: Strikethrough
More Natural Easing
n = 0; Formatted: Strikethrough
if (numKeys > 0){ Formatted: Strikethrough
n = nearestKey(time).index; Formatted: Strikethrough
if (key(n).time > time){
Formatted: Strikethrough
n--;
Formatted: Strikethrough
}
} Formatted: Strikethrough
if (n == 0){ Formatted: Strikethrough
t = 0; Formatted: Strikethrough
}else{ Formatted: Strikethrough
t = time - key(n).time;
Formatted: Strikethrough
}
if (n > 0){ Formatted: Strikethrough
t = Math.floor(clockTime);
h = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
ms = clockTime.toFixed(3).substr(-3);
minus + times(h) + ":" + times(min) + ":" + times(sec) + "." + ms
Formatted: No widow/orphan control
PULSE EFFECT
//Change Freq for times per sec and amp for how hard you
want the pulse. Adjust value at bottom to x,x to effect both x
and y values.
Follow “leader” layer position with added time delay. Formatted: Strikethrough
ADD: How to make this work with wiggle on the same layer? wiggle and this Formatted: Strikethrough
cancel each other out.
Exponential Scale Formatted: Strikethrough
s=Math.exp(transform.scale[0]/21.667905)-1; Formatted: Strikethrough
[s,s] Formatted: Strikethrough
Take any parented layer, apply this to position, and it will follow the parent, Formatted: Strikethrough
but on a delay. Formatted: Strikethrough
Formatted: Strikethrough
delay = 0.2; Formatted: Space Before: 14 pt, After: 4 pt, Line
parent.fromWorld(toWorld([0,0,0],time-delay)); spacing: Multiple 1.15 li
Formatted: Strikethrough
Formatted: Strikethrough
This is a collection of useful expression presets I’ve either written, copied or Formatted: Space Before: 0 pt, After: 0 pt, Line
modified from elsewhere on the Internet. If you have one to share, please let spacing: Multiple 1.15 li
me know! Formatted: Strikethrough
Formatted: Strikethrough
Delay inherited parent position
Formatted: Strikethrough
This one has lots of applications, like in this tutorial here. Take any parented Formatted: Space After: 0 pt, Line spacing: Multiple
layer, apply this to position, and it will follow the parent, but on a delay. 1.15 li
delay = 0.2; Formatted: Strikethrough
parent.fromWorld(toWorld([0,0,0],time-delay)); Formatted: Space Before: 14 pt, After: 4 pt, Line
spacing: Multiple 1.15 li
Autofade Formatted: Strikethrough
This fades in and out based on the in point and out point of the layer. Place in Formatted: Space Before: 0 pt, After: 0 pt, Line
spacing: Multiple 1.15 li
the layer opacity.
dur = 0.2; Formatted: Strikethrough
fadeIn = ease(time, inPoint, inPoint + dur, 0, value); Formatted: Space After: 0 pt, Line spacing: Multiple
fadeOut = ease(time, outPoint -dur, outPoint, value, 0); 1.15 li
Math.min(fadeIn, fadeOut);
Surprisingly, many light plugins like Lux, Optical Flares and Knoll Light Formatted: Space Before: 14 pt, After: 4 pt, Line
spacing: Multiple 1.15 li
Factory lack a way to diminish the light as it points away from the camera.
This can result in really tedious keyframing, unless you have a really Formatted: Strikethrough
After Effects cannot really do a sided object, at least not easily. But, you can Formatted: Space Before: 14 pt, After: 4 pt, Line
spacing: Multiple 1.15 li
have its opacity turn off the visibility when it is facing away from the camera.
This way you can even use two objects alternating, creating a fake 2-sided Formatted: Strikethrough
linear(timeToMarker, dur, 0, 100, 0) Formatted: Space After: 0 pt, Line spacing: Multiple
1.15 li
}catch(err){
100 //or whatevs
} Formatted: Strikethrough
Formatted: Space Before: 14 pt, After: 4 pt, Line
Fade Up and Down to/from marker spacing: Multiple 1.15 li
Formatted: Strikethrough
try{
Formatted: Space After: 0 pt, Line spacing: Multiple
dur = 10 * thisComp.frameDuration;
1.15 li
marker_time = Math.abs(time - marker.nearestKey(time).time);
linear(marker_time, dur, 0, value,0)
}catch(err){
Formatted: Strikethrough
value
Formatted: Space Before: 14 pt, After: 4 pt, Line
}
spacing: Multiple 1.15 li
Formatted: Strikethrough
This is a collection of useful expression presets I’ve either written, copied or
Formatted: Strikethrough
modified from elsewhere on the Internet. If you have one to share, please let
me know! Formatted: Space Before: 0 pt, After: 0 pt, Line
spacing: Multiple 1.15 li
After Effects cannot re ally do a sided object, at least not easily. But, you can Formatted: Strikethrough
have its opacity turn off the visibility when it is facing away from the camera. Formatted: Space Before: 0 pt, After: 0 pt, Line
spacing: Multiple 1.15 li
This way you can even use two objects alternating, creating a fake 2-sided
object. Formatted: Strikethrough
linear(timeToMarker, dur, 0, 100, 0) Formatted: Space After: 0 pt, Line spacing: Multiple
1.15 li
}catch(err){
100 //or whatevs
}
linear(marker_time, dur, 0, value,0) Formatted: Space After: 0 pt, Line spacing: Multiple
1.15 li
}catch(err){
value
} Formatted: Strikethrough
Formatted: Space Before: 14 pt, After: 4 pt, Line
3D Angle between two points spacing: Multiple 1.15 li
a=thisComp.layer("Null 1").position; Formatted: Strikethrough
b=thisComp.layer("Null 2").position; Formatted: Space After: 0 pt, Line spacing: Multiple
diff = sub(a,b); 1.15 li
2D Angle Between Points Formatted: Space Before: 14 pt, After: 4 pt, Line
spacing: Multiple 1.15 li
a = thisComp.layer("Null 1").toComp([0,0,0]);
Formatted: Strikethrough
b = thisComp.layer("Null 2").toComp([0,0,0]);
Formatted: Space After: 0 pt, Line spacing: Multiple
diff = sub(a,b); 1.15 li
radiansToDegrees(Math.atan2(diff[1],diff[0]));
dur = 2; //duration in seconds Formatted: Space Before: 14 pt, After: 4 pt, Line
spacing: Multiple 1.15 li
a = 0; //start value
b = 500; //end value Formatted: Strikethrough
Quick layer stacking. If you’re duplicating a bunch of 3D layers and moving Formatted: Strikethrough
them all back 1 pixel on the Z axis, put this expression on your second layer,
and each time you duplicate it the new layer will be pushed back one pixel:
Hey guys, do you know how to change both x and y scale of a layer when it is Formatted: Strikethrough
parented to another layer? >> A parenting to B (in scale)
So : scale A= scale B-10 Formatted: Strikethrough
Use Layer Marker Comment to drive Type Layer Formatted: Strikethrough
Set Opacity with last two numbers of Comp Name Formatted: Strikethrough
Doesn't work with 100 Formatted: Strikethrough