Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Accessing the result of an expression after it’s stopped

  • Accessing the result of an expression after it’s stopped

    Posted by Ben Forder on February 10, 2011 at 6:45 pm

    Hi,
    My brain is melting trying to work this out!!
    I have a really big expression thats working fine, but it has lots of looping in it so it’s really computationally intensive and slows my render speed right down. I just want to run for one frame, come up with a single value (for example a position) and then hold that value without re-calculating the expression every single frame, I don’t need the result to change over time).

    I’ve used an if statement like this
    if (time<=0.04)
    {
    blah blah big complicated expression
    }
    else
    {
    value
    }

    and it works for the first frame, but as soon as it passes to the next frame, it jumps back to the value it was at before my expression, instead of staying where it is.

    I also tried putting the expression in the source text of a text layer with a duration of only a frame, and having a simple expression on the position keyframe to take it’s values from that, but that seems to make it still re-calculate the text layer’s expression for every frame.

    I can’t use a script because it needs to run in aerender and the video assets don’t load before the script runs.

    Does anyone know a way around this?

    Thanks,
    ben

    if (time&lt;=0.04)
    {
    blah blah big complicated expression
    }
    else
    {
    value
    }

    Ben Forder replied 15 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    February 10, 2011 at 7:28 pm

    There’s no way for an expression to pass data from one frame to the next, and value always gives you the pre-expression value, so that approach is a dead-end.

    How about just converting the expression to keyframes?

    Dan

  • Ben Forder

    February 16, 2011 at 12:25 pm

    Thanks for replying so quickly Dan, I appreciate your time.

    That’s a shame, not being able to pass data from frame to frame makes what I’m doing quite hard then, but it’s good to know that limitation so I don’t keep banging my head against the wall.
    I tried converting it to keyframes, but it still has to do it for every single frame, so it won’t really speed things up when I’m doing massive automated batches in aerender.

    I’m going to try one last thing before I give up and just let it take hours to render every day. I thought maybe if I apply the expression to a single frame copy of the layer and write the results of the expression to a text file, then maybe the longer version of the layer can just read the values out of the text file, so it doesn’t reprocess the calculations each frame… I’m not sure if that’s even possible, I’m only just starting to teach myself javascript (mostly through creative cow!!)

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