Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions can you define a start (or end) value for an expression?

  • can you define a start (or end) value for an expression?

    Posted by Chris Chandler on July 31, 2008 at 12:07 pm

    Seems like this would be simple but I can’t figure it out for the life of me (new to AE)… I’m working on an animation where a ball with a logo on it rolls to a couple of different points on the screen and then comes to rest at a specific spot, and at that spot it has to be upright. What I have right now are keyframes set up for the positions, and have rotation set up as an expression linked to position. I’ve figured out what to multiply the expression by to make it look like the ball is actually rolling, but it has a mind of its own about what the rotation value is when it ends. Is there a way to set the value at that end point to 0 for rotation, and then have it work backwards from there?

    Chris Chandler replied 18 years ago 3 Members · 5 Replies
  • 5 Replies
  • Mike Clasby

    July 31, 2008 at 2:35 pm

    jj gifford use keyframes to change the wheels position, and an expression so the rotation always matches the movement. Maybe this will help:

    https://www.jjgifford.com/expressions/basics/range.html

  • Dan Ebberts

    July 31, 2008 at 2:45 pm

    We’d have to see your expression, but it might be as simple as adding an offset. That would affect the initial rotation though, and if you need it to start at zero and end at zero you might need to use a multiplier instead (like .99 or 1.01, for example) to make it rotate slightly slower or faster.

    Dan

  • Chris Chandler

    August 1, 2008 at 1:30 am

    Thanks, Mike and Dan. Using the link that Mike sent, I changed my expression so that it rolls more realistically, but I can’t find on that site where he uses keyframes to define the rotation at a given point. I think that method would be ideal if someone can’t point me to how I might do that (right now, any keyframes I try and tack on to rotation are overridden by the expression).

    Dan: perhaps an offset would work? Here’s where I’m at right now, my expression is:

    distance=position[0];
    circumference=width*Math.PI;
    distance/circumference*360;

    The end point that I need to reach is that at position 543.5, 240.5, rotation must equal 0. Right now, with the above expression, the rotation at that position is 4x +8.4

    The most user-friendly method possible to achieve that result would be awesome haha. I’m more familiar with keyframing from editing than I am writing script

  • Dan Ebberts

    August 1, 2008 at 2:18 am

    So how about if you change the last line to:

    distance/circumference*360 – 8.4;

    Dan

  • Chris Chandler

    August 1, 2008 at 3:19 am

    Perfect. Slowly but surely, scripting is starting to make a tiny bit of sense. Thanks a lot

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy