How to Link Multiple Paths With an Expression

Joe Clay Shows How to Link Paths on Different Layers Using a Slider.

Shape Layers and paths are amazingly powerful in After Effects. Still, users look for new ways to simplify the process. One method, of course, is to use expressions. When working with multiple paths in After Effects, you can create a single control that can help you animate them all at once. This is what Workbench’s Joe Clay shows how to do in his latest tutorial.

“we’re going to link paths on different layers using a slider so that we can animate them as if they’re a single stroke,” Joe Says. “This lets us easily pass lines around objects in 3D space without actually having to deal with 3D space and figuring out occlusion”.

The technique starts with a control null that has sliders assigned for an animation start and an end. Also needed is a slider for an element for multiple strokes or a bias. The expression for more than one stroke looks like this:

start = thisComp.layer(“Controller”).effect(“Start”)(“Slider”); //0
block = 100/thisComp.layer(“Controller”).effect(“Elements”)(“Slider”);
thisNum = thisLayer.name.substr(1,2);
rStart = (thisNum-1)*block;
rEnd = thisNum*block;
linear(start,rStart,rEnd,0,100);

Just change the parts that say “start” to “end” for the end parameter.

If you are working with two strokes and would like to control the bias between them, you can use:

bias = thisComp.layer(“Controller”).effect(“Bias”)(“Slider”);
start = thisComp.layer(“Controller”).effect(“Start”)(“Slider”);
linear(start,0,bias,0,100);

Again, be sure to replace “start” with “end” for the end parameter.