I'm editing a trim paths expression and have run into a little nuanced issue.
The smoke animation below (rendered quickly for demo purposes, so no judging) is going to be a sort of neon light animation (as is the rest of the comp), I just haven't gotten that far into building this. I slowed down the footage a little so you can see my problem, which is that the yellow dashed stroke is not lining up with the gray dashed stroke, though they have the exact same paths and dash settings.
The only difference is that the yellow stroke has an expression that tells it where on the path it needs to be. This is applied to the end of the path:
total = 5; step = 100/total; cycledur = .75; t = (time - thisLayer.inPoint); if (t < cycledur) { y = (step/(cycledur - cycledur/total))*(total-1)*t + step; ynorm = y/step; ret = step*Math.floor(ynorm); } else { ret = 0; } ret
and yes, before you say it: I defined a linear function by hand when I had the linear() method at hand. Oops. I forgot about it for a second.
What's actually happening? Inside the if conditional, I am taking the result of the linear function, then dividing it by the step value. Once that is done, I find out if I have reached the next step or not using the floor() function. Then I multiply back to get to the actual step.
(I put in some magic numbers that are actually defined in a null object layer, but that's just so you can see the numbers.)
The start property of trim paths simply reads the value returned in the above expression and subtracts the by the step number:
//step defined up here endv = content("blahblah")...end; endv - step;
The animation loops, and I have a debug text layer in the below animation showing the value of end on the rightmost path.
Notice that it is actually reaching 100% but also that the actual path ends well past the point it reaches. The silver lining is that it is following the path I guess.
How do I get one path to line up with the other? I can post pictures of the dashed line settings too, but there is no difference between the two.
UPDATE: I think I have begun to solve the issue. The start value of Trim Paths actually defines where the dashed line starts (or so it seems). Since the path does not exist yet, it is possibly just traveling 80% along the path (for example), starting there, then going 20% of the dashed-line distance. Since that 20% is not entirely stroked, I am receiving a little bit of the un-dashed areas, which is why it doesn't *appear* to go the full 100%. Okay. I will search for a solution to my boldfaced question, but I now know how to explain the discrepancy.