ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

How do I get layer length percentage value using expression?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Adirai Maji
How do I get layer length percentage value using expression?
on Sep 10, 2017 at 4:40:44 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.. :)


Return to posts index

Dan Ebberts
Re: How do I get layer length percentage value using expression?
on Sep 10, 2017 at 5:51:56 pm

Something like this maybe:

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

Dan



Return to posts index

Adirai Maji
Re: How do I get layer length percentage value using expression?
on Sep 10, 2017 at 6:07:28 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)


Return to posts index


Dan Ebberts
Re: How do I get layer length percentage value using expression?
on Sep 10, 2017 at 7:17:12 pm

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

Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]