Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Animating a trading candle with expressions

  • Animating a trading candle with expressions

    Posted by Andrey Gladkih on August 30, 2021 at 3:17 pm

    Hello!

    I am engaged in the creation of training videos on trading. I am making an animation for a candle. The “Y” scale of the “Body” shape is tied to the Slider control. I need to bind the “Y” scale of the “Stick” shape so that it grows with the “Body”, but stays in place if the value drops.

    The attached gif shows how this should work.

    Found the most similar expression, but still not quite the same.

    L = thisLayer;

    s = transform.scale.value;

    while (L.hasParent){

    L = L.parent;

    for (i = 0; i < s.length; i++) s[1,i] *= 50/L.transform.scale.value[1,i]

    }

    [s[0], value[1]]

     

    I’d be happy to give advice.

    Dan Ebberts
    replied 5 years ago
    2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    August 30, 2021 at 6:59 pm

    It sounds like your expression may need to start at the current time and examine every previous frame of the slider value, to determine the maximum. You might be able to simplify it, depending on how the slider is animated. For example, you might be able to get the previous maximum just by examining previous slider keyframes (if that’s how you’re animating the slider).

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