Skip to main content
andryh27333591
Participating Frequently
January 28, 2021
Question

I want to create animation template for graph/data grow over years

  • January 28, 2021
  • 3 replies
  • 1092 views

I have a job to create a video like this one, i conly can make basic motion graphic and a liitle bit of scripting

https://www.youtube.com/watch?v=k_I0zMidja4

How they made it i really have no idea? I know a basic script but i dont know how to make it

1. Do they input all the data 1 by 1 to script on after effect? or maybe take data from excel?

2. And it automatic switch if the number is growing higher etc


same like this

https://www.youtube.com/watch?v=dRQKl5mNkow

do they input data manually? or how?

 

thank you

This topic has been closed for replies.

3 replies

Community Expert
February 10, 2021

It's a fairly easy task to control the size and the position of a shape layer rectangle by driving each value with a simple expression tied to a slider. Sliders can be easily driven by a data file (JSON). If you add another slider at the bottom you can create a total of all the values of all the sliders. Divide that number by the number of layers to get a percentage value for each slider. Do some math on the percentage value and add that to a linear expression and you can control the position of a bunch of layers or the size of a bunch of rectangles with some pretty simple expressions. No recursive data required, just a little rounding and an accumulator and you should be able to have layers swap positions as their ranking changes and hold them there until the rank starts to change again. I'm guessing it would take me about a half-hour to put that together with a control null, 4 sliders, and 4 rectangles in a single shape layer. Then all that would be necessary would be to duplicate the sliders and the rectangles and tie a JSON file to the sliders. The sliders could also drive a text layer to display the values.

 

Maybe I'll give it a shot a little later this evening. It's not as easy as a pre-made script, but it should be fairly easy to do.

 

Slider 1

Slider 2

Slider 3

Slider 4

Total Slider = 1 + 2 + 3 + 4

 

Rectangle 1 Rank = Total Slider / Slider 1 value

 

Rectangle 1 Y position = Total Slider * Rectangle 1 Rank

 

Throw in some rounding and a linear method and that should do it. Repeat for each rectangle and you're done.

 

Tomas B. aka Tom10
Inspiring
February 9, 2021

Hey, to make this clear from the start - none of these examples were created in After Effects.

 

However, it is possible to achieve this with a combination of expressions and scripting. The reason being why I always suggest to avoid expressions-only approach - you need to efectively compare data. The bigger data set is going to be - the slower computation becomes, up to the point where its non-bearable. 

 

You can find initial approach of achieving these in After Effects in my Youtube channel here:
https://www.youtube.com/playlist?list=PLoAT2yyWEOrbAxaq8V8n-NxHfuXrEC3LF

 

Tutorial series will continue on breaking down the whole execution. Can't promise you that without any scripting knowledge you will be able to pull this through, but at least basic understanding will get you into successful thinking how bar chart race animation can be potentially achieved in After Effects. 

By the way, in case if someone is interested - in the past I made comparison of huge data set processing: made with expressions only by parsing .json as a footage, and achieving the same result though scripting. It resulted in SEVEN TIMES faster rendering speeds. For one time project - its definitely might be not worth learning scripting. But for anything dynamic, and re-usable long term - using expressions-only is a massive waste of resources. If the speed is essential - then consider scripting as your main path.

Mathias Moehl
Community Expert
Community Expert
January 28, 2021

I explain such a workflow in much detail in the section Data-driven Animation of my free eBook Motion Graphics in After Effects that Speaks to Your Brain

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Participant
February 7, 2021

Your ebook is really cool and helpful Mathias, nice work! 

 

I have a question: would it be possible to control animation timing via dynamic data? Our AE animation has closed captioning text, which we'd like to dynamically pull into the AE animation. The text is cut up into bite-size phrases that fade in, then fade out. The on-screen time for each text phrase will be different, so we'd like to pull in a dynamic "time" property for each text phrase, to control how long each text phrase appears on-screen.

 

Thank you!

Mathias Moehl
Community Expert
Community Expert
February 7, 2021

In principle that should be doable in two different ways:

A) each text on a separete layer, all spanning the entire duration of the comp. Then you apply an expression to the opacity of each text layer that reads the in and out times of this text from the data and sets the opacity to 0 if the current time is before the in time or after the out time and otherwise to 100 (plus some extra linear() expressions if you need to fade in and out).

 

B) just a single text layer with an expression on its source text property. The expression reads all texts and their in/out times from the data and then finds among the texts the one that should be visible at the current time and outputs it. Could be combined with a second expression on the opacity that does a fade in/out, if the current frame is near the in/out point of the current text.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects