-
Count frames until an animation property reaches a certain value
I have a simple animation, a shape layer is moving from left to right.
Now I want know at which frame the X-value of the reaches 500.
I have set up this expression, but it does not work:
var compLength = thisComp.duration / thisComp.frameDuration;
var posX = thisComp.layer(“shape”).transform.xPosition;
for (i = 0; i <= compLength; i++) {
posX.valueAtTime(framesToTime(i)) = 500
}
ii should return the frame value, but is doesn’t.
Any help would be greatly appreciated.