ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Create a bar which grows over time of the comp.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Martijn van Moock
Create a bar which grows over time of the comp.
on Sep 10, 2018 at 1:54:49 pm

Hi!

I'm trying to make a bar grow over time of the comp.
So I'm searching for an expression that gives me the current time, in the percentage where 100% is the total of the comp.

Does someone know what that expression could be?

Martijn


Return to posts index

Martijn van Moock
Re: Create a bar which grows over time of the comp.
on Sep 10, 2018 at 2:57:48 pm

Found it ☺

Only one question, does anyone know if it is possible to use it trough dynamic link? So for example, if you place a dynamic link clip in a premiere timeline and stretch it to the length you want. That the expression takes the length of the clip.

currenttime = timeToFrames(t=time + thisComp.displayStartTime, fps=1.0 / thisComp.frameDuration, isDuration=false); //current tijd in frames
compduur = thisComp.duration*25; //tijdsduur compositie

var1 = compduur/100;

var2 = currenttime/var1;

[var2]


Return to posts index

Scott McGee
Re: Create a bar which grows over time of the comp.
on Sep 10, 2018 at 7:48:54 pm

Simple answer is no.

You can only transfer so much over, but whatever the length of the project is in After Effects. Is what it will be.

Ways around it, if you know that your projects are never going to be longer than say 60 seconds always. Make it 60 seconds.

If using essential graphics, you can add a slider control that you can add length to for an outPoint, but if using dynamic link. It's more of a pain but can still be done. But you have to do it using a text layer to reference.

Also I'd use the expression in your scale if you literally want it to grow over the comp time

linear(time,inPoint,thisComp.duration,[0,100],[100,100])

I'd personally do it this way.

a = effect("Slider Control")("Slider");
linear(time,0,a,[0,100],[100,100])


This only works with essential graphics though.

For dynamic link

create a text layer called scale. Then add this expression to the scale on your bar.

a = parseInt(thisComp.layer("scale").text.sourceText);
if(isNaN(a)){
a = 1;
}else{
a;
}
linear(time,0,a,[0,100],[100,100])

This is then editable in the effects controls in the master section of premiere to trigger, but I would only do it this way if you don't have AE2017.2 or higher.


Return to posts index

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