ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Changing JSON Data Over Time

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Cutter Johnston
Changing JSON Data Over Time
on Jan 6, 2020 at 7:42:10 pm
Last Edited By Cutter Johnston on Jan 6, 2020 at 7:44:09 pm

I have JSON file driving text layers successfully. However, the JSON file represents a few hours of data [see snippet]. How do I get the text layers to change as the timeline advances? The expression is used for all layers with the respective name change.

Thank you!

Cutter



eval("var sales="+footage("csvjson01.json").sourceText);

sales[0].Sandwiches;


Return to posts index

Andrei Popa
Re: Changing JSON Data Over Time
on Jan 6, 2020 at 11:05:28 pm

eval("var sales="+footage("csvjson01.json").sourceText);

dur = 1; //Duration, in seconds, of each value
idx = Math.floor(time/dur);
(idx < sales.length) ? sales[idx].Sandwiches : sales[sales.length-1].Sandwiches;

Andrei
My Envato portfolio.


Return to posts index

Cutter Johnston
Re: Changing JSON Data Over Time
on Jan 6, 2020 at 11:17:21 pm

Andrei,

That worked! My arse is saved.

Thank you!

Cutter


Return to posts index

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