Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Loading bar animation bar by bar

Engaged ,
Nov 01, 2025 Nov 01, 2025

Hello community.

 

I'm seeing a heap of tutorials on YT, lots of instructors are using the trim path to make a loading bar animation, using the Dash to give it a more appealing visual. One thing I notice is, that the animating bar line, doesn't reveal one bar at a time, rather than each time the bar line animates, there's partially a bit of it revealed, then half of it, then the whole bar, until it goes to its next bar line. 

 

I'm also posting my tedious task, Ive also seek advice from Chat GTP. Make as many bars I need, put them on separate layers, then animate the opacity of the bar 0-100, the keyframes very closely to each other. then spread out the layers on the timeline to achieve one bar reveal at a time, yes it does work, but imagine If I have 100 of them.... So What would be a more swift method, an expression maybe?

Thank you.


StefanCargoski_0-1762048735274.png

 



below is some example of what tutorials are showing, which seems incorrect.

 

 

089c90e2-7e8b-4e9a-bb21-b5d5fbf80450.png

TOPICS
How to
127
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 05, 2025 Nov 05, 2025

I hadn't thought of Roland's method (which works obviously) but to another way is to use an expression on the repeater property:

Math.floor(value)

That takes whatever the value of the property is and rounds it down to the nearest whole integer. 

Translate
Advocate ,
Nov 02, 2025 Nov 02, 2025

As long as your path consists of two points with linear interpolation and you don't mess with the trim offset or the stroke offset, this expression on the trim start or end property should work (you will need to adjust the names of the properties to match what is in your shape layer contents):

var pathPoints = content("Shape 1").content("Path 1").path.points(time);
var pathLength = length(pathPoints[0], pathPoints[1]);
var dashLength = content("Shape 1").content("Stroke 1").dash.dash*2;
var numDashes = pathLength/dashLength;
Math.round(value/100*numDashes)/numDashes*100;

 If you want to do this on curving paths that is a whole other ball of wax.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 04, 2025 Nov 04, 2025

Hi Arron.
Thanks for your detailed explanation. I believe I got it, I had to do some minor adjustment, not sure if It was meant to be like this though. when I applied the expression, the bars did appear one at a time, but it did have a little pixel appearing of the next bar line, so I did a minor adjustment of the offset, and it cleared it from appearing.

Now one important factor if it's possible for accuracy. When the bar lines animate one by one, they are not pixel perfect sitting inside the grid. I notice in the dash settings, the minimum is 2, is there a way to get the bar lines sitting within the grid?

Thank you again.

This one hear had a little pixel appearing as the Line bars were animating

https://ibb.co/Cpyj9TgX

This is using 1 pixel grid example:

https://ibb.co/MDr4SCTr

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 03, 2025 Nov 03, 2025

Another alternative might be to make a single line and use the Repeater to create the bar.  Then you can animate the repeater number to increase.  So each line would snap into existence.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 04, 2025 Nov 04, 2025

Hi ShlverignCactus.

 

Your method is also helpful, but when the bar animates one at a time, the opacity is not 100%, it gradualy fades in from 0-100%. I tried to get chat GPT to write an expression, but to no avail. Is there a way to make each bar animate 100% opacity? Thank you.

https://ibb.co/tMmfJg78

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 04, 2025 Nov 04, 2025

Use a Text Animator. A capital L or I on a sans serif should do the trick. Then use transform.scale - scale up yScale. Apply Text Animator with the Scale Operator. 

HTH


Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 05, 2025 Nov 05, 2025

I hadn't thought of Roland's method (which works obviously) but to another way is to use an expression on the repeater property:

Math.floor(value)

That takes whatever the value of the property is and rounds it down to the nearest whole integer. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 05, 2025 Nov 05, 2025

OP mentioned having to animate 100 of these. So ... I just released a set of After Effects scripts and one of them is perfect for this - Keyframe Orchestrator was imagined and developed for users to control and animate lots of layers and keyframes without having to select a single keyframe - it's all done programmatically and rather easily too. If you can type in basic Expressions, this is a lot easier.

For what you're doing, if it expands to 100 layers, it shouldn't take more than 10 minutes to set this up and this includes full control over keyframe speed and influence and stagger options.

https://youtu.be/sAxOyre0jq4

Very Advanced After Effects Training | Adaptive & Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 05, 2025 Nov 05, 2025
LATEST

Your method was more simplified, but needed that expression to make it behave what I needed. 

Kind regards.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines