ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Path progress on specific point

FAQ   •   VIEW ALL
 Path progress on specific point on May 29, 2018 at 11:35:44 am

Hi all

With this expression I can set anothers layers position to be exactly half way on a path.

var pathLayer = thisComp.layer("Shape Layer 1");
var progress = 0.5;
pathLayer.toComp(pathToTrace.pointOnPath(progress));

My question is; is there a way to get the progress for specific Point (anchor/vertex) on the path. Say the path is made out of five points, can I somehow get the exact progress for the second point? Pretty sure this isn't posible with the default expressions, but I thought some one in here might had found a clever way to do it.

Thanks,
Jakob

 Re: Path progress on specific pointon May 29, 2018 at 1:21:53 pm

I don't know of an easy solution for this. I think you'd have to use some kind of iterative solution. I don't have the code for one, but I'd love to see it.

Dan

 Re: Path progress on specific pointon May 29, 2018 at 1:43:16 pm

Try this:

var pathLayer = thisComp.layer("Shape Layer 1");
pathLayer.points(time)[1]

you might need to do a comp/world conversion conversion.

-Alex

 Re: Path progress on specific pointon May 31, 2018 at 5:08:34 pmLast Edited By Kalleheikki Kannisto on May 31, 2018 at 5:22:31 pm

I wonder if it is possible to copy just one segment of a path to another path, say the path between points two and three, wherein it would be progress 0-1 between those point of the original path. Not sure if it is possible or even applicable for your needs, but it's a thought.

If it works, you would have the secondary path take on the first, then second, then third then fourth segment of the original path and progress 0-1 through each. Although traveling speed would change depending on segment length, so that wouldn't be much good if you need even progress...

Kalleheikki Kannisto
Senior Graphic Designer