AfterEffects_Tricks
Comments
 Share
The version of the browser you are using is no longer supported. Please upgrade to a supported browser.Dismiss

 
$
%
123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Still loading...
ABCDEFGHIJ
1
aFunctionNotesExpressionFunctionNotesUseful Plugin/ScriptDescription
2
http://www.shortcutworld.com/en/mac/After-Effects_CS5.htmlthisComp.layer(“Light 1“).toComp([0,0,0]);2D to 3D Null:beware! toComp/fromComp/toWorld/fromWorld/etc are complex and must be used carefullyhttps://github.com/chriskelley/work-scriptsA collection of scripts created for streamlining my compositing workflow in After Effects and Cinema 4D.
3
"alt" + "⇧" + "=" scpoint1=this_layer.position;
point2=this_comp.layer("Drag Me").position;
delta=sub(point1, point2);
distance=length(delta);
linear(distance, 0, 80, [250,250], [75,75]);
Apple Magnifying effect (Scales up when it touches Drag Me)http://www.smipple.net/tag/ft-toolbarJS for ft-Toolbar
4
"⌘" + "alt" + "/"Remove ExpressionsloopOut("cycle",0) | loopOut("pingpong",0)Loopchange 0 to 1 to loop the last two k frames of the time remap. "cycle" for cycle looping or "pingpong" for pingpong loopinghttps://drive.google.com/file/d/0B7LFUuSb6Ow7bmtRQXYwWWxZUTQ/view?usp=sharingPaul's TypeIn_Interpolate preset. Explained in Expression comments.
5
"+" and "-"Remove ExpressionsseedRandom(index,true);
myValue = random(50) ;
Frozen random numberhttps://www.dropbox.com/sh/y7fgh4tg1ks76k2/AABe7rkgsID3EBYGwMetnQ5Sa?dl=0Jorge's AE toolbox
6
"alt" + "["Cut in pointdelay = 5; //number of frames to delay
d = delay*thisComp.frameDuration*(index - 1);
thisComp.layer(1).rotation.valueAtTime(time - d)
DelayDELAY FOR SPECIFIC LAYER

lay = thisComp.layer("SquareMoves")
delay = 1; //number of frames to delay
d = delay*thisComp.frameDuration;
lay.rotation.valueAtTime(time - d)
http://www.batchframe.com/custom_controls/
7
"alt" + "]"Cut out pointlay = thisComp.layer("Null 3")
wrld=lay.toWorld(lay.position);
[wrld[0],wrld[1]]
connect to real world position of something (x, y)IF IT DOESN'T WORK (if you have the layer connected to a null for example) change it to the anchorPoint, so:
lay = thisComp.layer("Null 3")
wrld=lay.toWorld(lay. anchorPoint);
[wrld[0],wrld[1]]
https://www.dropbox.com/s/bgnf9hlxkezj2df/sw_BeatSequencer.jsx?dl=0Wrote this for a job i'm on, useful for placing layers or comps in time with music.

Select the layers you want to dupe, then a layer with Markers on it and hit the button.
8
"⌘" + "⇧" + "d"Duplicate Layer in positionlay = thisComp.layer("Null 3")
wrld=lay.toWorld(lay.position);
[wrld[2]]
connect to real world position of something (z)IF IT DOESN'T WORK (if you have the layer connected to a null for example) change it to the anchorPoint, so:
lay = thisComp.layer("Null 3")
wrld=lay.toWorld(lay.anchorPoint);
[wrld[2]]
https://bitbucket.org/snippets/kyletmartinez/
9
"j"next keyframen=thisComp.layer("Null 2")
nullpos=n.toComp(n.anchorPoint);
fromComp(nullpos);
connect to real COMP position of something (x, y)ESPECIALLY PUPPET TOOL POINT TO NULL
10
"k"previous keyframeseedRandom(index,true);
freezeTime = random();
Math.min(time,freezeTime)
Random Freezed frame
11
"alt" + ","On/Off Proportional GridthisComp.layer("Controller").effect("Controller")("Slider")/50connect timeRemap to slider (0 to 100)
12
"alt" + "⇧" + "f"fit to screenposterizeTime(12);
value;
play precomp at 12 fps (even inside a 24fps comp)you can also do this: posterizeTime(comp("comp").frameDuration)
13
"alt" + "+" or "-"scale (hold shift for +-10)In Slider:
effect("Angle Control")(1)%360

In Time Remap:
effect("Angle Control")("Angle")/24;
connect to timeRemap to Angle Slider/24 = frameRate
%360 = frames inside precomp
(1) = sometimes needed before %360

14
"⌘" + "Shift" + "k"keyframe velocitydistance=position[0];
circumference=width*Math.PI;
distance/circumference*360;
perfect wheel car simulation / rotationput the radius of your circumference (wheel) in the "width" spot in the expression
15
"⌘" + "Option" + "k"keyframe interpolation fps=15; //frequency
amount=50; //amplitude
wiggle(fps,amount,octaves = 1, amp_mult = 0.5,(Math.round(time*fps))/fps);wiggle(fps,amount,octaves = 1, amp_mult = 0.5,(Math.round(time*fps))/fps);
Jumpy Hold Wiggle: wiggle but with hold keyframesSimple, f - a parameters control speed and distance of jump
16
"⇧" + "esc"toggle between compsGo back and forth between actual comp and the previous one opened100 - thisComp.layer("OTHERLAYER").transform.opacityOpposite Transparency from layer to layer
17
ON TERMINAL:
kill ~SEGV #
if AE is froze, saves your project filefind after effects number on monitor. open terminal and put the action, replace # with AE monitor number.posterizeTime(5);
wiggle(5,35)
Wiggle with posterize!RANDOM each frame:

posterizeTime(0.000001);
wiggle(5,35);
18
"Command" + "Option" + "L"Reload selected footage itemsposterizeTime(12);
value;
Regular posterize to 12 fps
19
"Shift" + "F3"toggles between Timeline/Graph Editorw = wiggle(2,50);
[w[0],value[1]]
Wiggle only in X
20
"Shift" + "EE"Hides Expressionsw = wiggle(2,50);
[value[0],w[1]]
Wiggle only in Y
21
"x"Scrolls to first active selected layer. Loop your wiggle!

loopTime = the length in seconds of your loop
22
In Timeline: Alt-click one keyframe, then anotherInfo panel shows duration between keyframesFaster than having to manually step through timeline to count framesL = thisComp.layer("Null 1");
L.toWorld(L.anchorPoint)
world position
23
⌘Eopens selected layer directly in PS, AI, Premiere, Cinema 4D… the original program used to create it.x = transform.position[0];
y = transform.position[1];
w = wiggle(3, 200);

[w[0], y];
wiggle in one direction
24
In Graph Editor: ALT-click any curveSelects all points on the curveThis sometimes ends up being a lot faster than having to marquee select the entire curve.[position[0], position[1],0.5* thisLayer.index];duplicate layer in z spacePaste it on the position parameter and start duplicating the layer
25
In Graph Editor: CTRL-click curveAdds additional points to curveFaster than scrubbing input to add a point to the curves=Math.exp(transform.scale[0]/21.667905)-1;
[s,s]
Exponential Scale
26
In Graph Editor: ALT-click any point on curveToggles between linear point and BezierFaster than having to open Keyframe Interpolation and encourages unique ease beyond standard Easy Easen=0;if(marker.numKeys>0){n=marker.nearestKey(time).index;if(marker.key(n).time>time){n--;}if(n==0){value;}
else{
t=time-marker.key(n).time; //time since marker
//Do Stuff
}} else value;
Trigger expression on markerReplace ‘//Do Stuff’ with code to be triggered at a maker. One use is to trigger keyframed animation from the begining of the layer (eg. valueAtTime(inPoint+t))
27
In Graph Editor: after selecting keyframe, hold down CTRL while moving keyEngages Snap function in curve editorCool thing about this is that the Snap function includes lots of stuff, like key values, work area, and the CTI. It's annoying to always turn the Snap button on and off — this makes it quick and painless.i = index-parent.index-1;Use with array expressions to measure the relative index from a layer to its parent/controller.
28
In Timeline: CTRL-click "Twirl Triangle" of a layerFolds and unfolds Layer attributesI use this to clean-up a layer that has lots of properties that can be twirled (like Particular), basically a reset button for a layer's UI; can also be used on complex folder hierarchies in Project windowvalueAtTime(framesToTime(linear(parentslider,0,100,-100,100)));Remap an animation on the first 100 frames using a slider from -100 to 100.Replace "parentslider" with the reference to your slider effect. Really useful for character rigging.
29
In Graph Editor: Graph OptionsOptions to show Timeline-centric info in the Curve EditorI turn on Show Layer Markers & Show Layer In/Out in that second dropdown at the bottom of the curve editor so I can make timing notes in the timeline with Layer Markers, but still see them in the Curve Editori = index-parent.index-1; parentproperty.valueAtTime(time+i*offset);Delay a property from a controller based on the relative index.Replace "parentproperty" with the controlling property.
30
In Graph Editor: Show PropertiesFilter on/off which curves are viewedEver turn on that little Graph Editor switch next to a properties keyframe — and now no matter what you select, that property is stuck in the GE? Turn off Show Graph Editor Set in the first dropdwon at the bottom of the GE to make it go away for the time being.xAmp = 3; //height of undulations (pixels)
xFreq = .3; //undulations per second
xSpeed = 150; //speed of wave (pixels per second)

wl = xSpeed/xFreq; //wavelength (pixels)
phaseOffset = ((position[0]%wl)/wl)*2*Math.PI;
y = xAmp*Math.sin(2*Math.PI*xFreq*time + phaseOffset);
value + [0,y]
undulating surface: POSITION
31
In Timeline: CTRL + ALT click keyframeConvert to hold keyframeA little faster than right-clicking and searching for Toggle Hold KeyframexFreq = .3; //undulations per second
xSpeed = 150; //speed of wave (pixels per second)
damping = 15; //undulation damping factor

wl = xSpeed/xFreq; //wavelength (pixels)
phaseOffset = ((position[0]%wl)/wl)*2*Math.PI;
theta = Math.atan(Math.cos(2*Math.PI*xFreq*time + phaseOffset));
radiansToDegrees(theta)/damping;
undulating surface: ROTATION
32
CTRL+SHIFT+ALT+UDisplay as wireframeQuality & Sampling toggle switch in the timeline is weird, only toggles between Best, Draft, and Bicubic. Useful to draw a particularly slow layer quickly without having to go full-on wireframe modeif (numKeys >1 && time > key(numKeys).time){
t1 = key(1).time;
t2 = key(numKeys).time;
span = t2 - t1;
delta = time - t2;
t = delta%span;
valueAtTime(t1 + t)
}else
value
Loop Mask AnimationApply to mask path of layer to loop keyframed masks.
33
delta = position - thisComp.layer("TARGET").transform.position;
radians_to_degrees(Math.atan2(delta[1],delta[0]))
Add to Rotation of 2D null and will aim at "TARGET" layerdelta = toWorld(anchorPoint) - thisComp.activeCamera.toWorld([0,0,0]);
radiansToDegrees(Math.atan2(delta[0],delta[2]))
34
(hasParent) ? parent.opacity : value;Inherits opacity from parentThe additional bits of code catch any accidental unparenting
35
(hasParent) ? (parent.opacity/100) * value : value;Inherits opacity from parent but retains the child's editabiltyThe parent's opacity value acts as a mulitplier for the child's
36
L = thisComp.layer("parent");

p0 = L.transform.position.valueAtTime(0);
p1 = L.transform.position;

[2*p0[0]-p1[0],p1[1]]
Takes parents position independently in one or more direction. With abality to adjust speed
37
nominalDist = 200;

d = length (thisComp.layer("Camera 1").toWorld([0,0,0]),toWorld(anchorPoint));
value*(d/nominalDist)
add this expression to the stroke width of a 3D shape layer to keep the same width no matter where in Z the layer is
38
try{
s = scale [0]/100;
L = thisLayer;
while (L.hasParent){
s *= L.parent.scale[0]/100;
L = L.parent;
}
w = value;
w/s
}catch(e){
value;
};
add to stroke width of shape layer to maintain stroke and path width during scalevalue/(scale[0]/100)
39
L = thisComp.layer("SPoint");
L.toComp (L.anchorPoint);


L = thisComp.layer("EPoint");
L.toComp (L.anchorPoint);
link Beam effect to two diferrent nulls
40
s = [];
ps = parent.transform.scale.value;
for (i = 0; i < ps.length; i++){
s[i] = value[i]*100/ps[i];
}
s
Maintain scale when parented
41
loopOut("continue");continue value of keyframes
42
colors=[
[141,203,235,255]/255,
[187,223,243,255]/255,
[164,213,239,255]/255,
[205,219,143,255]/255
];

amCol = 4 //Number of colours in the list above
colors[Math.floor(random(amCol-0.0001))];
random colours from range///If you want to hold colour, add:

amCol = 4 //Number of colours in the list above
seedRandom(1, true);
colors[Math.floor(random(amCol-0.0001))];
43
Add it to a null "position"Create smooth rolling credits (jgadpp.com)Create a null, go to Animation>Add Expression. Paste it. Then parent all your credits to the nullrate = 4; //value in px/sec.
value - [0,rate*timeToFrames(time)]
It will make your credits run smoothYou can change the rate value at your will.
44
sliderPos = thisComp.layer("Slider").effect("Slider Control")("Slider");
framesToTime((Math.round(sliderPos)))
TimeRemap to slider
45
w = wiggle(5,30);
[w[0],w[0]]
Wiggle Uniform Scale
46
Wiggle Scale One Axis
47
// Throw (move at a constant speed without keyframes)
veloc = -10; //horizontal velocity (pixels per second)
x = position[0] + (time - inPoint) *veloc;
y = position[1];
[x,y]
Constant move in axys X
48
delay = .05;
leader = thisComp.layer(1);
leader.transform.rotation.valueAtTime(time - delay*(index-leader.index));
Delay 2
49
.valueAtTime(time - 2*thisComp.frameDuration)add to the end of any espression to offset or delay the expression.
Helpful for precomps
50
Ctrl+shift+Alt+right arrowadvanced keyframe
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Loading...
 
 
 
Sheet1