Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects How to limit the values ​​of a property to a specific range?

  • How to limit the values ​​of a property to a specific range?

    Posted by Davi Alves on September 8, 2022 at 8:02 pm

    Hi, I’m having trouble applying an idea I had in my composition. I will try to explain my idea as objectively as possible. I have a circle where the scale values ​​are linked with the pick whip on another object, I want to do the following:

    If the scale assumes a negative value, the scale value will be equal to 0. This will make the scale never be negative, that is, the scale will only assume positive values. How do I do that?

    I put this in my circle’s expression code:
    temp = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);
    [temp, temp]
    if(temp < 0) temp=0

    Did not work. There was an error.

    Dan Ebberts replied 3 years, 11 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    September 11, 2022 at 10:56 pm

    I think you just need to change the order:

    temp = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
    if(temp < 0) temp=0
    [temp, temp]

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