Progress Bar Tutorial w/ Percent Sign - T049
Вставка
- Опубліковано 5 вер 2024
- In this After Effects motion graphic tutorial we are going to be taking a look at how to rig a progress bar / loading bar or percentage bar in After Effects. This percentage bar / progress bar uses a Slider Control to determine the the scale of the progress bar, the percentage, and the position of the percentage indicator.
The percentage sign is "baked" into the slider controller number so a secondary text layer is not necessary. This trick can be used for dollar signs as well.
Formulas:
thisComp.layer("Null").effect("Slider Control")("Slider").value.toFixed(0) + "%"
x = (x2) - (100-Slider)*(x2-x1)/100
In this After Effects motion graphic tutorial we are going to be taking a look at how to make an animated number counter / UA-cam view counter with comma. This technique was learned through Creative Cow and uses After Effects CC scripts to accomplish a number counter with Slider Control.
CreativeCow.net (script)
forums.creativ...
✖ New Website - www.MoboxGraph...
✖ Twitter - / moboxgraphics
✖ Instagram - / moboxgraphics
✖ Facebook - / moboxgraphics
Music by: www.epidemicso...
Workstation:
Intel i7 4790 @ 3.60GHz
PNY GeForce GTX 770 w/ 4Gb ram
32Gb DDR3 @ 2400GHz
500GB Samsung Solid State HHD
2TB Standard Drive
MSi Z97-G55 Motherboard
I record with GeForce Shadowplay
Motion Tool: www.mtmograph.c...
Editor's Note:
Loading bars in after effects are quite diverse, but often time require animated numbers. To animate a number counter in after effects, it's important to use a number slider and after effects expressions. In addition, often time you're required to include a comma, period, dollar sign, or percentage sign to the animated numbers. Without proper expressions, this is very complex. Counting numbers up or counting numbers down is as simple as utilizing a slider controller i.e. after effects number slider. Animated counting number or animated UA-cam view count is a basic after effects tutorial technique that everyone needs to know. Hope you learned a thing or two.
x=thisComp.layer("Null").effect("Slider Control")("Slider").value;
linear(x,0,100,165,1755)
this will work as well
+Artyom Hov. Thanks!!
Pretty useful, thank you so much! :D
what is the programming language that u are using
This expression worked wonders! Instead of entering different values for the length of the bar, can I tie those values (100, 165, 1755) to an expression where they automatically change instead of manually entering the values.
Not really. You will not be able to edit graph neither with 'linear' nor with 'ease' expressions.
Another solution for X Position of the Pointer:
pInitial=thisComp.layer("Progress Bar").transform.position[0];
SizeBar=thisComp.layer("Progress Bar").content("Rectangle 1").content("Rectangle Path 1").size[0];
Where=thisComp.layer("Null 2").effect("Slider Control")("Slider")/100;
temp=pInitial+(SizeBar*Where);
[temp];
---------
Explanation:
The initial X Position of the Pointer must be the initial X Position of the Progress Bar. >>> pInitial
The X Position of the Pointer along the time will be the initial X Position of the Progress Bar plus the length variation of the Progress Bar.
We must use the first value (a) of the size of the Progress Bar (a,b) to get its length. >>> SizeBar
The value of the Slider Control must be in percentage so we will divide it by 100. >>> Where
The length variation of the Progress Bar is SizeBar multiplied by Where.
I haven't tried this, but I'm pinning it as it may help other users. Will try this when I get home! Thanks for the comment Raquel
Today I tried to do it instead of adding the video to Watch Later Playlist. I didn't know about "value.toFixed(0)". Thanks for sharing it!
This was the only method that worked for me! Thanks.
This expression worked for me as well, although Is there a way to get rid of the /100 part so that the pointer just aligns automatically instead of adjusting that /100 value?
If you still want to do the method in the video, I suggest making variables so that if you have to change the values at any given point you just only have to do it once and won't miss anything. Like:
var x1 = 165;
var x2 = 1755;
x2(100 - slider)(x2 - x1)/100;
Not sure if you need semi-colons, but I think that'd be a little less confusing and easier to manage. Overall it's a great tutorial and I'm trying to learn to do animations like these.
or get the values from the parent like position left and position left + width
Thanks for the video. Trying to learn something new everyday in After Effects.
Probably one of the best AE tuts on UA-cam
Hmmm, why not a black stroke with trim path linked to the slider control?
nice
Can you share for download a template, or how to do it on premiere pro?
You. Thank you for the tutorial. It was really helpfully
To make the bubble follow the size of your bar, you can make a new path the same size of your bar, than use create nulls from paths and then you take out the expression on progression , put it in 100 % and your stoke (the path) you have to parent it to your barre, and your bubble you have to parent it to the null. Now your bubble follows your bar :) but I think it is not more easy or better, it is just a different way.
I hope I was clear.
Woooooow! This is some mad science stuff here!
Dammmmnnn, you save me, i need to learn more of this wizardry expressions thing. Tnx a lot!
Thank you so much sir for your kind tutorial . Really apreciate your efforts keep rocking
This was a really awesome tutorial. This is the kind of thing that really opens my eyes to what's possible with formulas. Keep up the great work.
Yeah, you could have easily keyframed the position of the marker, but I really think there is a lot of value when a composition is rigged together so keyframes don't get in the way and you can really focus on creating the smoothest / best motion and timing.
Glad this helped!
I'm definitely going to be using this technique on a video project I have coming up. There are a lot of changing numbers and percentages and this kind of thing will make things a bit easier to adjust. Also, I totally didn't know you could use expressions to add a % at the end of a number sequences. This is going to save me a ton of time doing the 2 layer method you referenced.
Yeah somebody asked me last week how to do it, and I was determined to figure it out! Not a lot of resources out there for such a simple request, believe it or not.
It seems the general rule of thumb is any time you ask yourself, "There has to be a better way to do . . ." there probably is. I've picked up a lot of time-saving tips from a lot of your videos but this is definitely one of the most practical tutorials I've seen in a while.
Yeah expressions are the new frontier for me. I'm only just now getting familiar with everything they can do. There's always a better, faster, more efficient, cleaner, smoother way of doing anything. It's both great, but also exhausting.
did not know I wanted this until I saw it.
cool tutorial, thank you!
I have a better alternative for you.
1>>You can use the numbers from the text layer to scale the length of the bar.
2>>The code in the text layer actually returns string but in can be converted with parseInt().
3> Then alter it with linear expression you want.
//This would convert text from the Text layer to number;
var temp =parseInt( thisComp.layer("count").text.sourceText);
[temp,100]
//Use the same link in the parent layer of that pointer and text.
var temp = thisComp.layer("Shape Layer 1").transform.scale[0];
var pos =linear(temp,0,100,496,1224);
[pos,524];
I've created recently a progress bar tutorial where you dont need to used fixed position values but inherit it from the parent.
how can it be done if the total isn't a percentage. for example 900
ty
Best one, needed that expression thanks, you got my sub
Nice tutorial! Thank you so much, my friend!
Do you know what I have to do if I want to put the percent sign smaller than the numbers?
You are awesome!
Thank you, so much. That was helpful.
Thank i find the percentage follow the bar fomular long time
Nice!
Wow, just checked out your channel. You're a master at AE!
Thanks! Always trying to get better at this craft! Hey, I just released a new show at my channel, maybe you could participate one day. I can add subtitles.
I've learned a lot, thank you :) !
couldn't you just parent the number shape to the position and change the position of the bar instead of scale.
+Stolen yes but then the number would not be a percentage. But I suppose you could just do x2/x1*100
Thank you!
Tell me please what should I do if I need 75%?
This formula actually turns numerical values (that the position uses) into %, so you can just change the last keyframe to 75, and your bar will stop at 75% of the path.
Nice useful Tutorial
You are a genius !!!
great Tutorial
Great tutorial!
Thanks for watching!
Dude, you save me!
thank... this is what i need :)
Dude, you're cool, thank you.
Do you think you can release a template for this?
thanks soooooo much
awesome
Thanks... Problem solved
ammmmmmm i would rather download the template and edited instead of making it because it looks so confusion and i suck at this math thing lol :) but good tutorial
+WinCity it's super simple if you follow the steps :)
Jesus Christ.. right after you say: Now you see, its fully attatched... But there's a problem!
I'M LIIKE.. WHAAAT? Dude just created a formula... no problems should come for the rest of the day at least.. hahah
a tutorial is how u explain things sweetie you already has everything madr
second!
:D
These videos are like crack to me. I think there's a problem.
awesome tutorial. Thank you! I need come back to my math class hehehe Greating from Panama.