Copy link to clipboard
Copied
Can I use a Clamp expression to limit a time expression?
Lets say I have a bird wing on Layer A. Layer A is 3D. Putting a time expression (time*100) on the Y position attribute revolves the wing 360 degrees. I would like to limit the rotation to, say, 60 degrees. I thought that I could "clamp" the rotation, but this isn't working. I'm new to expressions so it may be something simple I did wrong.
If this is even possible how would you write this? I tried writing the clamp expression first, second, and putting it on a sperate line. None of that worked.
Try something like this:
t = time - inPoint;
ease(t, 1, 1.6, 0, 60)
That expression will start rotation 1 second after the in point of the layer and increase the rotation from zero to sixty in the next .6 seconds. Your original expression rotated the layer 100º / second so ".6" seconds equals 60º.
Copy link to clipboard
Copied
You wouldn't clamp, you use linear(), ease() etc. to define upper and lower ceilings. The rest is unclear. Always post the code when talking about expressions or provide screenshots of the timeline with the expression editor visible, including which property it's applied to.
Mylenium
Copy link to clipboard
Copied
Try something like this:
t = time - inPoint;
ease(t, 1, 1.6, 0, 60)
That expression will start rotation 1 second after the in point of the layer and increase the rotation from zero to sixty in the next .6 seconds. Your original expression rotated the layer 100º / second so ".6" seconds equals 60º.
Copy link to clipboard
Copied
Thank you Rick, for your very helpful answer!
Copy link to clipboard
Copied
If I wanted to loop this so the wing flapped continuously, I would use a loop expression as well?
Copy link to clipboard
Copied
The easiest way to create flapping winds is to set two keyframes and add loopOut("pingpong"); as an expression.