ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Use .csv data string as source text

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Julian Leupold
Use .csv data string as source text
on Jul 22, 2018 at 10:09:02 am

I have generated a .csv Excel sheet from GoPro footage that includes gps, acceleration, gyro, etc. data.
Every data set is build up similiar like the example i've pasted in below.

What i need is kind of a script for my source text in AE that can handle the given values and automatically creates keyframes/switches through the list.
Is this possible with a string expression?

Thank's for your help.

Milliseconds,AcclX,AcclY,AcclZ
0,16610,4390,16063
5,16385,-10661,-16721
10,-16245,-3763,15976
15,16556,11288,16337
20,16545,4704,16397
25,-16112,-25399,16313
30,-16276,-9094,16257
35,16554,-28535,16219
40,16409,-8153,16258
45,-16369,10348,16137
50,16527,25399,16261
55,16521,-3136,16259
60,-16285,-11288,16081
65,-16219,28535,16294
70,16600,22577,16314
75,16116,-1568,16270
80,-16160,-15365,16228
85,16522,16933,16272
90,16549,13483,16317
95,-16221,-26340,16233
100,16398,25713,16082
105,16635,-28848,16278

AND
SO
ON
...


FOR
GPS:

Milliseconds,Latitude,Longitude,Altitude,Speed,Speed3D,TS
0,48.4028122,10.3111031,4041.487,42.286,42.34,0
52.63157894736842,48.4028322,10.3111123,4041.59,42.301,42.36,0
105.26315789473684,48.4028522,10.3111214,4041.685,42.348,42.37,0
157.89473684210526,48.4028723,10.311131,4041.806,42.395,42.42,0
210.52631578947367,48.4028923,10.3111402,4041.913,42.407,42.46,0
263.1578947368421,48.4029124,10.3111496,4042.02,42.421,42.48,0
315.7894736842105,48.4029324,10.3111587,4042.124,42.423,42.49,0
368.4210526315789,48.4029525,10.3111679,4042.255,42.423,42.49,0
421.05263157894734,48.4029725,10.311177,4042.378,42.422,42.49,0
473.6842105263158,48.4029926,10.3111862,4042.506,42.437,42.49,0
526.3157894736842,48.4030127,10.3111953,4042.635,42.447,42.5,0
578.9473684210526,48.4030328,10.3112043,4042.764,42.466,42.52,0
631.578947368421,48.4030528,10.3112133,4042.898,42.452,42.53,0
684.2105263157895,48.4030729,10.3112223,4043.024,42.463,42.52,0
736.8421052631578,48.4030931,10.3112314,4043.156,42.48,42.53,0
789.4736842105262,48.4031132,10.3112404,4043.288,42.497,42.55,0
842.1052631578947,48.4031334,10.3112495,4043.418,42.514,42.57,0
894.7368421052631,48.4031536,10.3112585,4043.55,42.527,42.58,0
947.3684210526316,48.4031737,10.3112676,4043.68,42.536,42.6,0
1000,48.4031939,10.3112765,4043.813,42.555,42.6,0
1055.5555555555557,48.4032142,10.3112855,4043.948,42.575,42.62,0
1111.111111111111,48.4032344,10.3112946,4044.09,42.598,42.64,0

AND
SO
ON
...


Return to posts index

Dan Ebberts
Re: Use .csv data string as source text
on Jul 22, 2018 at 8:18:15 pm

You could create a script that would read the file and create keyframes for the data, or, with newer versions of AE, you could import the csv file and use an expression to interpolate and display the the data.

The syntax for accessing the data from an expression would be something like this:

footage("your data.csv").dataValue([0,0])

where the dataValue() parameters specify the column and row of the data element you want to parse. Presumably, your expression would need to read through the data to find the timestamps before and after the current comp time and interpolate the data from those timestamps to get the current value. Hard to be more specific without knowing exactly what you're trying to do.


Dan



Return to posts index

Julian Leupold
Re: Use .csv data string as source text
on Jul 22, 2018 at 9:09:30 pm

Thank's for your reply Dan!

I've already found out how to access the JSON with:

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

json[0].AcclX;


My problem is that i'm only looking at the first case and AE doesn't cycle through the cases.

I would need the script to be modified so that every frame/millisecond the case would go on.
Starting with [0].


Return to posts index

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