Highlighted

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

Explorer ,
Sep 13, 2020

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

TOPICS
Expressions

Views

71

Likes

Report

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

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

Explorer ,
Sep 13, 2020

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

TOPICS
Expressions

Views

72

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 13, 2020 0
5 Replies 5
Most Valuable Participant ,
Sep 14, 2020

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

Likes

Report

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

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

Likes

Report

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

Copied

Likes

Report

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

Copied

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

Likes

Report

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

Copied

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

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 15, 2020 0
Resources
Troubleshooting FAQs
After Effects Community Recap
Getting started with After Effects