Getting Values from csv like LOOKUP in excel
So I have a table which would like that:
My Basic ideas would be to import it in AE as CSV
In my comp I will have
- the CSV,
- a Control layer with 3 sliders; Day, Session and Pres
- and two text layers, Title and Names
So by setting the values on the slider the Title and Names change accordingly
ex: if Day = 1 and Session = 1 and Pres = 1 then value for Title = "Title One" and value for Name = "Name one"
My table will have more than 50 rows so using a if or switch expression is not really an option.
I stumpled upon this video, explaining how JSON files can be linked to your after effects project. Maybe they can be of use for you?
I made a mock table like yours in excel,
copied it all, and went to:
that gave me a JSON-string like this:
I copy-pasted that data into a text-layer I called "Data", then hid the text-layer.
Since we need to do a lookup on 3 numbers to get out two values, I thought it would be easiest to just concatenate the three lookup values, so day 3, session 1, pres 2 will become the unique string: "3|1|2"
I'm creating a new object that holds data like this:
So ideally, you would do some pre-processing in another app (or you could even do that in Excel, to get data like this into after effects, and looking up the value would be rather simple.
Just as a purely academical example, here is the inefficient way to just do it every frame in an expression: