Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CSV data-driven animation for position and time

New Here ,
Mar 30, 2021 Mar 30, 2021

I have a .csv file with multiple occurences (rows) and to each occurence there is an xyz coordinate and a timestamp (four columns). In After Effects I would like to have a circle glow for each occurence, at the position and time determined by the data.
Existing expressions I've come across seem to use the data source to pull text or number content, but I haven't seen examples where data determines position and time.

Any ideas or examples you know of are much appreciated, thank you.

TOPICS
Expressions
1.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 30, 2021 Mar 30, 2021

No different than any othe CSV-driven expression stuff. You will just have to add some more fancy to actually parse the values into something usable rather than just making them appear as text, so after the initial line to fetch the value from the CSV you have to add the actual logic. Doing positions is easy enough and you can look up other such expressions to learn the drill. You only replace the references defined by sliders or Null objects. Similarly, making stuff appear is merely a matter of understanding valueAtTime() or the linear() functions to turn stuff on and off, for which enough examples also exist. Of course there may be any number of special provisions and caveats, but without seeing your data and understanding your project setup nobody will be able to give you some tailor-made copy&paste expressions. The devil's in the details, as always...

 

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 30, 2021 Mar 30, 2021

Thank you, Mylenium, it's good to know it's possible to do.

 

The source data is like the sample below but extending for thousands of rows:

x,y,z,time

0.849096054710926,-7.72883543289989,-0.364316490565184,0
0.85216052687273,-7.73379173417934,-0.363103870036746,1
2.60777572371671,-0.110870325856147,1.14989728220931,0
3.33148671749037,7.00566346007523,5.24360254887773,0
-4.12389152979097,2.41193494244211,0.894619578526746,0

 

And the project setup would be a circle shape layer with a blur and glow effects. It's this shape layer I would like to show, for a duration of 2 frames, at each position, at the corresponding time (the time unit in the data sample above is frames, at 30fps). (think many blinking lights organized according to the data)

 

If you have additional guidance or if you can point me to where I may find similar expressions to do what is needed here, I would appreciate it.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 30, 2021 Mar 30, 2021

Question about your data--the x,y, and z values seem quite small, and the time values don't look to be chronological. Is that what the data really looks like? With a single shape layer, you can't have multiple events at the same time, and if they're not sorted in time order, that will make things a lot messier (I think).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 30, 2021 Mar 30, 2021

Thank you, Dan.

Yes, the x,y and z values are correct, the unit is meters. In the entire dataset the position values in each axis span between -7 and 7.

Regarding the time variable, there are some occurences that are simultaneous, never more than 4 or 5 (in the sample above there are four occurences on the first frame taking place at different positions; and there is one occurrence on the second frame). I can split the data into several .csv files to avoid a frame repetition and have each data file inform a different shape layer, if that makes sense and solves the problem you are pointing.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 30, 2021 Mar 30, 2021
LATEST

How do your physical unit measurements relate to actual pixels? That's the first thing you have to figure out or else this would be going nowhere. Unlike @Dan Ebberts I don't think the chronological order would be an issue - you simply read the line and whether it's visible or not would be intrinsic to the calculations in the expressions. It would just complicate matters by having to have a loop that combs through all data entries instead of linearly associating time with the current frame and have the built-in automatism do it.

 

Mylenium

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines