Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animating a table with expressions

  • Animating a table with expressions

    Posted by Enrico Vicino on July 10, 2019 at 1:09 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

    Andrei Popa replied 7 years, 1 month ago 2 Members · 1 Reply
  • 1 Reply
  • Andrei Popa

    July 11, 2019 at 8:14 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.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy