Activity › Forums › Adobe After Effects Expressions › Create a bar which grows over time of the comp.
-
Create a bar which grows over time of the comp.
Posted by Martijn Van moock on September 10, 2018 at 1:54 pmHi!
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
Scott Mcgee replied 7 years, 11 months ago 2 Members · 2 Replies -
2 Replies
-
Martijn Van moock
September 10, 2018 at 2:57 pmFound 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 compositievar1 = compduur/100;
var2 = currenttime/var1;
[var2]
-
Scott Mcgee
September 10, 2018 at 7:48 pmSimple 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.
Reply to this Discussion! Login or Sign Up