ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Find the postition of the End Point of a Trim Path

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jacob Roth
Find the postition of the End Point of a Trim Path
on Jul 24, 2019 at 4:18:40 pm

Hi everyone.

So I have a stroke with a trim path, and I'd like to attach a point control to the one end of the stroke as it moves along a trim path. Even better would be if the point control follows the end of the stroke even if I change the offset. Any ideas how I would accomplish this?


Return to posts index

Dan Ebberts
Re: Find the postition of the End Point of a Trim Path
on Jul 24, 2019 at 6:08:49 pm

Something like this should work:

L = thisComp.layer("Shape Layer 1");
p = L.content("Shape 1").content("Path 1").path;
offset = thisComp.layer("Shape Layer 1").content("Shape 1").content("Trim Paths 1").offset;
pct = L.content("Shape 1").content("Trim Paths 1").end/100;
offsetPct = (pct+ offset/360)%1;
L.toComp(p.pointOnPath(offsetPct,time))


Dan



Return to posts index

Jacob Roth
Re: Find the postition of the End Point of a Trim Path
on Jul 24, 2019 at 7:30:22 pm

Works like a dream! Thanks Dan.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]