ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Animating a table with expressions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Enrico Vicino
Animating a table with expressions
on Jul 10, 2019 at 1:09:03 pm

Hi,

here is what I would like to do:

Have an animated sports table with say 30 teams for a time period auf 30 days.
Per day the position of each team should change accordingly to its ranking - for instance team1 ranked no.1 on day one but lost and went down to no.2 on day 2 etc. I want this to be based on data I can input into a text-document or csv or a json. Then maybe have a linear expression to read out the data as an array. But that may not be the best way to do it. So the final result should show a representation of the changing rankings of each team over a period of time.
How would you approach this task without keyframing everything? Any hint on where to start from would be great!

Cheers


Return to posts index

Andrei Popa
Re: Animating a table with expressions
on Jul 11, 2019 at 8:14:42 am

I see 2 ways there. Either create 30 arrays with the rank on each team per day(like tottenham = [12,11,14,etc]) or one with days and the teams(day1 = ["Manchester","Liverpool"]) etc. The days approach would be maybe nicer to read.

So if we take the second approach you must create a json file that is similar to this:

{

"day1":[
"Manchester",
"Liverpool",
"Chelsea"
],
"day2":[
"Liverpool",
"Manchester",
"Chelsea"
],
"day3":[
"Liverpool",
"Manchester",
"Tottenham"
],
"day4":[
"Liverpool",
"Spurs",
"Chelsea"
]
}


The easiest approach inside the after effects is to create 30 text layers(they must start from index 1) and write this to their textSource:

eval("var standings =" + footage("delete this.json").sourceText);
delay = 3;
dayNumber = 4;
x = "day"+(Math.floor(time/delay)+1);
(time/delay<4) ? standings[x][index-1] : value;


Delay is how often they change, dayNumber is the total number of days.

If you want to animate the position of those teams, it's a more sophisticated matter.

Andrei
My Envato portfolio.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]