Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Running a Simple Simulation in AE

  • Running a Simple Simulation in AE

    Posted by Joseph Francis on June 25, 2014 at 7:12 am

    When I was a kid I used to use high school math and simple laws of force, gravity, mass, acceleration and velocity to simulate a bunch of bodies orbiting in mutual gravitational attraction. The objects would slingshot around and do all kinds of unpredictable things.

    Is this possible in After Effects using expressions? It’s obviously possible for certain physics engine plugins to do that and far beyond, but they seem to run everything in advance and load every object with key frames at every frame. I think. Is it possible to do something simpler in AE?

    For example, I’d like to keep an acceleration vector and at every frame I’d like to use it to update a velocity vector (by adding the two), and then use that to update a position (by adding the two). It just looks like AE doesn’t work that way, and I have to be able to express everything as a function of time. I don’t want to pre-plan all the functions f(t), I just want it to crank along from state to state where each new state arises from applying a simple set of rules to the current state. Possible?

    Joseph Francis replied 11 years, 10 months ago 3 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    June 25, 2014 at 8:40 am

    Expressions have no way to pass any information from one frame to the next, so if your calculation depends on a previous calculation, you need to re-create the previous value, either by setting your calculation up as a function of time, or you can use the brute-force iteration method of starting at frame zero and looping through your calculation until you get to the current frame.

    Dan

  • Joseph Francis

    June 25, 2014 at 1:43 pm

    Is this the sort of thing that could be handled in a script that keeps track of every object’s motion and sets key frames for it at every frame?

  • Dan Ebberts

    June 25, 2014 at 4:03 pm

    That should work. You have the advantage of persistent variables, but the disadvantage of it being not as easy to tweak the parameters.

    Dan

  • Joseph Francis

    June 25, 2014 at 4:05 pm

    thanks

  • Filip Vandueren

    June 27, 2014 at 6:22 am

    Take a look at Newton:

    https://aescripts.com/newton/

  • Joseph Francis

    June 27, 2014 at 6:49 am

    Newton looks cool, and I’ll probably get it, but I’m just trying to understand what I can do with AE itself.

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