Skip to main content
immortalights
Known Participant
September 13, 2020
Answered

Can I Use A Clamp Expression To Limit A Time Expression?

  • September 13, 2020
  • 2 replies
  • 967 views

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.

This topic has been closed for replies.
Correct answer Rick Gerard

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º.

 

 

 

2 replies

Rick GerardCommunity ExpertCorrect answer
Community Expert
September 14, 2020

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º.

 

 

 

immortalights
Known Participant
September 15, 2020

Thank you Rick, for your very helpful answer!

Mylenium
Legend
September 14, 2020

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