Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Make property Value move in increments of 10

  • Make property Value move in increments of 10

    Posted by Chris Heuer on November 18, 2020 at 4:15 pm

    I am driving an audio meter graphic with Sound Keys. My audio meter has 10 rectangle segments stacked (a stroked shape layer with Dashes). My Sound Keys Output is from 1 to 100, so I’d like to have my Sound Keys output be restricted to only moving up or down in round units of 10 (0,10,20,30). That way each rectangle on the meter appears and disappears as a whole.

    Dan Ebberts
    replied 5 years, 5 months ago
    2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    November 18, 2020 at 4:53 pm

    Like this:

    SK = thisComp.layer("Black Solid 1").effect("Sound Keys")("Output 1");

    Math.floor(SK/10)*10

    or this:

    SK = thisComp.layer("Black Solid 1").effect("Sound Keys")("Output 1");

    Math.round(SK/10)*10

  • Chris Heuer

    November 18, 2020 at 5:04 pm

    You are an amazing human & genius! I wish I spoke math better. I spent 2 hours trying to do this before asking. I did try /10*10 but that is the only similarity to your solution.

  • Chris Heuer

    November 18, 2020 at 5:11 pm

    If you don’t mind me asking, what is the difference between .floor and .round?

  • Dan Ebberts

    November 18, 2020 at 5:26 pm

    Math.floor rounds down to the nearest integer, Math.round rounds to the nearest integer.

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