Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Slider control updating value

  • Slider control updating value

    Posted by Crichton Meadows on August 22, 2017 at 4:24 pm

    I am trying to rotate an object with an expression but when I increment the rotation value it always resets on every frame, so it would be going back and forth, is there any way to save the value from frame to frame?

    keyFrameVar = thisComp.layer("Black Solid 2").effect("Sound Keys")("Output 3")
    value + keyFrameVar

    Andrei Popa replied 9 years ago 2 Members · 3 Replies
  • 3 Replies
  • Andrei Popa

    August 22, 2017 at 7:07 pm

    If you want to create some sort of dependencie between frames, i think you should use time. something like
    keyFrameVar = thisComp.layer("Black Solid 2").effect("Sound Keys")("Output 3");
    frameNumber = time/thisComp.frameDuration;
    value + keyFrameVar*frameNumber

    this way you multiply keyFrameVar by the number of frames(like adding it for each frame)

    Andrei

  • Crichton Meadows

    August 23, 2017 at 12:00 am

    Unfortunately, I can’t use time. I need the value to be an accumulation of over time of another input.
    What I don’t understand, is that the ‘value’ variable seems to always be set to the initial value at the first rendered frame.
    When the expression returns a value, I expected that to be stored for example in the slider and when the next frame is rendered the ‘value’ variable would be the current value of the slider.

  • Andrei Popa

    August 23, 2017 at 8:06 am

    After Effects expressions have no memory. Each frame they execute your code from zero. Nothing is saved over time except time. But i think that there is some workaround for your problem. You can execute the code for the whole addition each frame. The downside is that if you have a very long composition it will start running slow.

    keyFrameVar = thisComp.layer("Black Solid 2").effect("Sound Keys")("Output 3")
    frRate =1/ thisComp.frameDuration;
    keyFrameSum = 0; //
    for (i=1; i

    Andrei

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