• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Explorer ,
Sep 13, 2020 Sep 13, 2020

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.

TOPICS
Expressions

Views

518

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 14, 2020 Sep 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º.

 

 

 

Votes

Translate

Translate
LEGEND ,
Sep 14, 2020 Sep 14, 2020

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 14, 2020 Sep 14, 2020

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

 

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 15, 2020 Sep 15, 2020

Copy link to clipboard

Copied

Thank you Rick, for your very helpful answer!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 15, 2020 Sep 15, 2020

Copy link to clipboard

Copied

If I wanted to loop this so the wing flapped continuously, I would use a loop expression as well?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 15, 2020 Sep 15, 2020

Copy link to clipboard

Copied

LATEST

The easiest way to create flapping winds is to set two keyframes and add loopOut("pingpong"); as an expression.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines