Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression-driven vehicle

  • Expression-driven vehicle

    Posted by Joe Laude on August 4, 2009 at 12:50 am

    This was just an experiment, nothing for a production, but I decided to try to write an expression that would drive a little vehicle or spaceship to move based on a heading and a velocity. Simple physics. It works in theory, but not in practice. It isn’t recursive, so it only reads the values without the expression modifying it.

    After seeing it, I recalled reading someone I think here saying that After Effects just doesn’t do that. Understandably so, as it would eventually cause an infinite loop if it didn’t eventually stop at a certain frame. You guys know if I can tell it to stop at frame 0 and have After Effects recalculate each new frame based on the last one’s calculation?

    Joe Laude replied 16 years, 9 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    August 4, 2009 at 3:49 am

    After Effects is, by design, stateless. That’s what allows you to jump the time marker to anywhere in the timeline and still have it render correctly. So expressions don’t get any information about their values at previous frames. You can, however, create a loop, that starts at frame zero and moves forward, frame-by-frame, calculating the cumulative result as it goes. The expression takes longer to calculate at each frame, of course, so there is a practical limit to the usefulness of this method, but for most applications it’s quite workable.

    Dan

  • Joe Laude

    August 4, 2009 at 5:38 pm

    So how would you do that?

  • Joe Laude

    August 4, 2009 at 8:43 pm

    I tried a while loop and it does indeed work. It slows down as it progresses, like you said, as each frame adds one more loop it has to go through each time.

    Thanks.

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