Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How do I get layer length percentage value using expression?

  • How do I get layer length percentage value using expression?

    Posted by Adirai Maji on September 10, 2017 at 4:40 pm

    Hi I just simplified my question by adding this image

    As you can see there are two text layers with dynamic texts, which shows current length of the layer played…

    The Red layer is 200 Sec long
    The Green layer is 100 Sec long.

    But what I want to achieve is.. I want to show the percentage of the total length played for each layer.

    in this screenshot for the position of current time indicator the Red text should be shown as 50 and the Green text should be as 100.

    Hope you understand my question…

    Thanks in advance.. 🙂

    Dan Ebberts replied 8 years, 8 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    September 10, 2017 at 5:51 pm

    Something like this maybe:

    (100*(time-inPoint)/(outPoint-inPoint)).toFixed(0)

    Dan

  • Adirai Maji

    September 10, 2017 at 6:07 pm

    Thank you so much. How did I forget simple formula for find percentage….

    And can you tell me what is the use of this code? .toFixed(0)

  • Dan Ebberts

    September 10, 2017 at 7:17 pm

    toFixed() converts a number to a string with the specified number of decimal places (zero in this case).

    Dan

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