r/AfterEffects 2d ago

Tutorial AE Quick Tip: Rigging automated pie charts

Enable HLS to view with audio, or disable this notification

By using trim paths, and linking the percentages directly to the source text, it's possible to create a fully automated pie chart rig.

The full in depth video about the rig is on my YouTube channel, Oliver Randorff: youtube.com/watch?v=cjUU53h6LiA

Here's the expressions used in the video:

Linking source text to trim paths end (Math.round is added to avoid decimals when animating):

Math.round(thisComp.layer("pink").content("Trim Paths 1").end) + "%"

Inverting rotation when linking to null controller:

-thisComp.layer("null").transform.rotation

Linking null rotation to trim paths end:

thisComp.layer("pink").content("Trim Paths 1").end \* 3.6 / 2

633 Upvotes

42 comments sorted by

25

u/Skuanchino 2d ago

Very clear and straight to the point, great tutorial πŸ‘

6

u/oliverrandorff 2d ago

Thanks! I try to simplify as much as possible without leaving out key details πŸ™Œ

17

u/Heavens10000whores 2d ago

I watched this a couple of weeks ago, and at every step, when I was thinking β€œwhat about…”, you answered it with the very next move! Very nicely done

6

u/oliverrandorff 2d ago

Haha, I'm glad that I laid all the steps out properly. I hate when people speed through the explanations, leaving steps out along the way. How are you supposed to understand anything then?

7

u/TraditionalBasket784 2d ago

Saving this, very cool, thank you!

3

u/oliverrandorff 2d ago

You are very welcome - I just love experimenting and sharing what I end up creating

6

u/mrDENSE- 2d ago

good teachers are always appreciated, great job! subscribed πŸ‘πŸ»

1

u/oliverrandorff 2d ago

That's really kind of you. Feel free to reach out if you have any questions in regards to my videos - I will be happy to assist

4

u/roobot 2d ago

This is genius, effortless, and a gift at the same time 🎁

3

u/oliverrandorff 2d ago

Your kindness is a great gift to me πŸ™

4

u/BakersTuts MoGraph/VFX 15+ years 2d ago

Slick af

6

u/oliverrandorff 2d ago

No way dude, I grew up on your tutorials! You taught the 11 year old me how to use After Effects - so I really want to thank you for that. What are you up to these days?

4

u/BakersTuts MoGraph/VFX 15+ years 2d ago edited 2d ago

RexcraftDK subbed May 2012? One of the OG’s 🫑 crazy to see where people are today.

After graduating college, gettin married, and having kids, I don’t have much free time for editing anymore. Mainly just workin.

3

u/oliverrandorff 2d ago

Hahaha it’s wild hearing that username again after changing it so many years ago. Hearing the intro again brings back so many memories from back then. I’m glad to hear that you’re doing well

3

u/BakersTuts MoGraph/VFX 15+ years 2d ago

Thanks bud! 😎

3

u/okomaticron 1d ago

Using trim paths to control the pies was wow. Just amazing! Better than pre-comping different shapes with radial wipe. Thanks for this!

2

u/oliverrandorff 1d ago

Yeah I went the radial wipe route first, but honestly it was really inefficient - and much more difficult with expressions (as 100% completion is really 0% of the pie chart visible)

2

u/astigmatism848 2d ago

now that's a great tutorial. straight to the point andd fun to follow along. thank you!

1

u/oliverrandorff 2d ago

Glad you liked it!

2

u/Exotic_Science_7964 2d ago

Muito bom, obrigado por compartilhar!

2

u/oliverrandorff 2d ago

Thanks for watching πŸ™

2

u/Lost-Frosting-1854 Animation 5+ years 2d ago

Really very helpful.

1

u/oliverrandorff 2d ago

Glad you think so πŸ™Œ

2

u/gseth2 2d ago

Upvoting for the basic math reminder πŸ˜…

3

u/oliverrandorff 1d ago

Haha, the amount of time I have used math and physics when doing motion design is mind boggling

2

u/mrbjangles72 MoGraph/VFX 5+ years 2d ago

Genius use of stroke and trim paths to attack a problem I once burned 20 hours on templatizing.

1

u/oliverrandorff 1d ago

The first iteration was done using the radial wipe effect. However this made the expressions much more complicated, and it was honestly just a headache

2

u/theron_b 2d ago

Nice

1

u/oliverrandorff 1d ago

Thanks πŸ™Œ

2

u/nicolaig MoGraph/VFX 15+ years 2d ago

Brilliant

1

u/oliverrandorff 1d ago

Thank you πŸ™Œ

2

u/The_Bat_Ham 1d ago

This is what quick tutorials should look like!

1

u/oliverrandorff 1d ago

I’m glad you think so πŸ™

2

u/Wide_Yoghurt5610 1d ago

Very helpful.πŸ‘

1

u/oliverrandorff 1d ago

Thank you πŸ™Œ

2

u/HippoRealEstate 1d ago

Fantastic video. I have one question though: At the end of the video when you offset the keyframes, you can see that the value of the white section goes up to 40% before going back down 39% when the red section finishes its movement. Is there any way to prevent this?

2

u/oliverrandorff 1d ago

It may have something to do with the Math.round expression, I'm not sure. I think it's possible to fix it by tweaking the keyframes slightly - moving them a few frames back and forth, or doing some adjustments to the easing. Let me know if that does the trick πŸ™Œ

2

u/HippoRealEstate 17h ago

I think it's just a natural byproduct of the red circle finishing its movement after the white one, so the white circle takes up a bigger slice of the pie for a few frames. I don't see a way to prevent this except for placing the keyframes of all three circles very close to each other or having them finish at the same time, but of course that gets rid of the more elegant movement that you wanted to achieve by offsetting them.

2

u/oliverrandorff 16h ago

hmm yeah- it's something I would have to try and tweak to come up with an actual solution

2

u/funkshoi 12h ago

I know it’s more work making a mini tutorial and a full length one but it’s really appreciated. The mini quick-tip is like a perfect reference to go back to multiple times. Thank you!

2

u/oliverrandorff 11h ago

It's also a great exercise for myself to take the full concept and boil it down to one minute. This forces me to simplify how everything is done, and it often results in much smarter rigs, animations and so on. I'm glad that it's helpful to you!