The key is pointOnPath() which lets you track a shape layer’s path. Here’s an example that uses a slider (0-100) to control percentage travel along a path:
s = effect("Slider Control")("Slider").value/100;
L = thisComp.layer("Shape Layer 1");
p = L.content("Shape 1").content("Path 1").path;
L.toComp(p.pointOnPath(s,time))
Dan
From: After Effects Mail List <AE-List@media-motion.tv>
Sent: Tuesday, April 10, 2018 10:24 AM
To: After Effects Mail List <AE-List@media-motion.tv>
Subject: [AE] Expression to follow shape layers?
I thought this was introduced in 15.0, but I can find any reference to making a layer follow shape layers shape using expressions? Did I dream this?
Mike Powers
Director of Animation \ Cramer
781.278.2354
mpowers@cramer.com
https://vimeo.com/mpowers
3DBOXX W8920Processor 32.0 GB RAM
Dual Xeon CPU E5-2670 0 @ 2.60GHz, 2601 Mhz, 8 Core(s), 16 Logical Processor(s)
Windows 10 Enterprise - 1709 (OS Build 16299.64)
NVIDIA GTX TITAN Black RAM 6.0 GB Driver Version 2.1.2 NVIDIA 388.31