6 votes

After Effects distance between two points

Hate to spoil all your good work, but it's a lot easier to use the built-in length() function: length(pointa, pointb) e.g. length(thisComp.layer(1).position, thisComp.layer(2).position) or ...
user avatar
  • 13.4k
5 votes

How to loop an animated mask?

This expression is not supported for Mask Path Property, because it's a User Defined Property, see the note of the error message. Workaround Mask Path animation once Precompose your layer an with ...
user avatar
  • 2,279
5 votes

How to import 2D position data into After Effects

Found the answer here. Copying any positional keyframes out of After Effects generates a text file like this: Adobe After Effects 8.0 Keyframe Data Units Per Second 25 Source Width 100 ...
user avatar
  • 6,398
4 votes
Accepted

After Effects: Parent a Camera's position to a Null-Object with specific Off-Set

To drive an animation by another layer use the pick whip or the selection list to parent it. In the following example the Camera (layer) adopts all animation properties of the Null. Note: Camera is a ...
user avatar
  • 2,279
4 votes

How to loop an animated mask?

Another option if you don't want to create a pre-comp: Make your mask and set the keyframes and apply this expression to the mask path property: valueAtTime(time % key(numKeys).time) This is ...
user avatar
  • 13.4k
4 votes
Accepted

After Effects: Make beam effect go over end/beginning

You can't do it with the beam effect as it stands. But… A workaround would be to move your start and end points further out along the line that they define. A bit of maths and an expression will do ...
user avatar
  • 13.4k
4 votes

random copied and being truly random

The random number generator in AE seems to be linked to the layer index, but generates the same results for every composition. To demonstrate here's a comp with a shape layer where the vertices of the ...
user avatar
  • 13.4k
3 votes

After Effects distance between two points

I figured it out. The syntax and/or order of operation could not handle squaring two numbers before adding them, so I added parenthesis to isolate each number and square them BEFORE adding them ...
user avatar
  • 185
3 votes

Can an expression parse a text file or the expression of another property in After Effects?

Yes, since expressions are basically JavaScript, you can load and evaluate external source files. Unfortunately the location needs to be hard-coded, since (AFAIK) expressions do not have access to the ...
user avatar
3 votes

Physics and Chemistry Animations in After Effects

There are a number of physics engines and related scripts available in the Physics Simulation category at AEScripts. However, without a more specific question about what kind of animation you're ...
user avatar
3 votes
Accepted

changing this code to check for a collision from a specific layer

Yes, checkLayers() is what is performs the collision test, and compares every layer in the Comp against the one running the script. To check against only one layer, you could re-write that function a ...
user avatar
3 votes
Accepted

After Effects: controlling slider in ExtendScript

I found out - .value after slider.effect("Slider Control").property("Slider") and it works. var a = slider.effect("Slider Control").property("Slider").value
user avatar
  • 151
3 votes

Parent a Position X from Particular World to it's own transform xPosition

There's no property called xPosition, and transform is a property of a layer, not a method, but you're on the right track. The expression has to return an array of two values [x, y], and the ...
user avatar
  • 13.4k
3 votes
Accepted

Scaling "Stroke" Effect "Brush Size" while scaling composition?

Easy fix, you see the small sun icon on the imported comp layer? Disable that, that basically means that the comp should act like the layers within it should act like they are in the parent comp. It ...
user avatar
  • 7,109
3 votes

After Effects: Images on whole pixel still blurry edges

So, I figured it out by myself. The problem was the anchorpoint. My images were on even pixels but the anchorpoint was odd. So the solution is to use following expressions: // Position newX = Math....
user avatar
3 votes
Accepted

Scripting - Where is the documentation for the Layer#Effects attribute?

I actually found the answer in the CS3 scripting guide. CompItem#selectedLayers actually returns an array of AVLayer objects. AVLayer is a subclass of Layer and has quite a few attributes. Here are a ...
user avatar
  • 161
3 votes

How to Sync a Layer's Position, to a Layer in Another (Time Remapped) Comp

If you want to link certain properties through several composition you can only do this with expressions. They are really not difficult though and its a matter of 1-2 lines. F.e. to get the position ...
user avatar
  • 7,109
3 votes
Accepted

AE Counter Switch (Mins > Hs)

Make three text layers with a slider on each. Call the layers value 1, value 2, and value 3. In the source text of each of the text layers put this expression, to display the slider value and round ...
user avatar
  • 6,398
2 votes
Accepted

Can you measure the width of a character in an AE expression?

Looks like Adobe have come to the party on this one. A new update as of After Effects CC 2014.2 (13.2) has a sourceRectAtTime() method that does exactly what I'm wanting. To quote their blurb: You ...
user avatar
  • 13.4k
2 votes

Can you measure the width of a character in an AE expression?

So you want the width of the whole text object no single characters? In that case you could use this: http://motionboutique.com/text-bounds-expresssion-580/ A tutorial plus sample project on how to ...
user avatar
  • 7,109
2 votes
Accepted

Defining animation once, then repeating across a selection of shapes in a cascading manner?

Assuming the same thing happens in each window... Make the action that will be inside the first window in its own comp. Then duplicate the comp 19 times, and use something like the brilliant ...
user avatar
  • 6,398
2 votes
Accepted

After Effects: Create an isometric/orthographic Camera

Use a camera with a long focal length. The longer the focal length, the closer to isometric. Just back the camera far enough away to frame the shot.
user avatar
  • 4,201
2 votes

After Effects: Increment a Variable over time

You can loop over the range of frames from the start of the comp to the present and calculate the value along the way. function myFuncf(theTime){ //whatever the function you're using to create the ...
user avatar
  • 13.4k
2 votes
Accepted

How to automatically pull text out of a video

I do not know of any existing solutions for this in Premiere or AE. However, if you know a little about programming, you might be able to write a script using OpenCV that runs Tesseract OCR on video ...
user avatar
2 votes
Accepted

Can an expression parse a text file or the expression of another property in After Effects?

You can't put the expression on a null object, but you can use a text layer. Following @bobtiki's eval() tip I tried using the source text of a text layer and running eval() on it. Initially I had no ...
user avatar
  • 13.4k
2 votes
Accepted

AE: Hide object after random time

I'm not sure what the valueAtTime function is trying to achieve. That takes the value of the property at the given time. In the script you wrote it would sample the value of the opacity at a point a ...
user avatar
  • 13.4k
2 votes
Accepted

Link audio to opacity effect of an image in After Effects

The easiest way to do this is to use an expression. First you convert audio to keyframes. Then set an expression on your opacity channel. If you drag the pick-whip for the expression to the audio ...
user avatar
  • 13.4k
2 votes
Accepted

Control key frame value with slider control

You were close. if (numKeys > 1){ t1 = key(1).time; t2 = key(2).time; v1 = [95, 95]; //or if it's 3d [95, 95, 95] slider = comp("INPUT").layer("CONTROL").effect("Zoom intensity")("Slider");...
user avatar
  • 13.4k
2 votes
Accepted

set scale in pixels in After Effects using Expressions

The size in pixels is easily computed as the source's original dimensions multiplied by the scale. Or in other words p = d × s where p=pixel dimensions required, d=source dimensions, s=scale. So ...
user avatar
  • 13.4k
2 votes
Accepted

Create an animation of a slider-crank mechanism system

The setup is reasonably simple, built in functions, trigonometry and some Pythagoras will get you there. Have a look at the diagram below: The orange solid is the crank, with its anchor point shown ...
user avatar
  • 13.4k

Only top scored, non community-wiki answers of a minimum length are eligible