- July 24, 2019 at 4:18 pm
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?
- July 24, 2019 at 6:08 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;
- July 24, 2019 at 7:30 pm
Works like a dream! Thanks Dan.
- April 23, 2021 at 2:38 pm
Hi Dan. I am having a similar issue to Jacob at the moment.
Are you suggesting here to apply this expression to the point control itself?
Am trying to have a trim path stroke loop using an offset, expression linked to a slider, but also want a few shape layers to loop with the stroke. Have tried using create nulls from paths (trace null) in order to parents the shapes to the null but can’t seem to find a way to get my null to loop with the stroke offset, as I normally just expression link the null to the start or end point of the trim.
Thank you in advance.
- April 23, 2021 at 6:31 pm
Actually, if you’re applying it to a point control, you’d want to change the last line to this:
Log in to reply.