OK, first thing - unless your data contains complex objects, forget JSON. After Effects can read CSV or TSV files just fine, and more efficiently since there's less packing. Remember the data file is read continually just in case a value has updated, that's the point behind the "dynamic" data feature. Let's suppose you have a CSV file that begins something like this... Speed,Battery,Gear 80,99.6,D 82,99.5,D 81,99.4,D etc. In scripting, row and column counts begin at zero, so the "data " for speed starts at [0,1] - ignoring the column header - and continues [0,2] ... [0,3].... etc. It's important to have the header row as we'll see shortly. Second thing - don't put your data into the composition as a layer. You simply read it from the project panel directly. So, import the CSV file - let's say it's called "data.csv" - and create a text layer in your composition. Twirl down to "Source Text" and alt-click the stopwatch to create an expression. Assuming your composition is running at 50fps and the data is 50 samples/sec, all you need to get is the data point for the frame number (since frame numbers begin at 1, that header row in the file is automatically ignored). You get the frame number using timeToFrames(), and you get a CSV cell using dataValue()... so for "speed" write this in the expression: t = timeToFrames(); footage("data.csv").dataValue( [0,t] ) For "gear" just change the column number t = timeToFrames(); footage("data.csv").dataValue( [2,t] ) If the composition frame rate doesn't match the sample rate, insert a line that does some math with "t" before using it. If your composition is NTSC 29.97 and your sample rate is 50Hz, that math will hurt. Blame the NTSC. Notes: Rather that writing footage("data.csv") every time you can pickwhip the data file directly from the project panel while the expression editor is open. You must have enough data - if AE reads beyond the end of a file, it'll throw an error. To "pause" on the last entry, you can use a simple restriction on the value of t, such as if (t>1000) t = 1000;
... View more