FORUMS: list search recent posts

Change text from an array on every frame

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Maurizio Costa
Change text from an array on every frame
on Aug 25, 2012 at 1:54:58 pm

Hi everyone,

I'm working with time lapse photography. I would like to use a text layer to show Aperture and Time values during the movie.
I extracted those values via Lightroom and some plugin and stored them in a CSV file.

So: I need a text layer to show a different number on every frame of my animation.
The numbers to show could be stored in an array, too, without linking to an external file.

How can I write the expression?


Thanks in advance.


Return to posts index

Dan Ebberts
Re: Change text from an array on every frame
on Aug 25, 2012 at 3:31:41 pm

What does the data in the CSV file look like?

Dan



Return to posts index

Maurizio Costa
Re: Change text from an array on every frame
on Aug 25, 2012 at 5:59:44 pm

Hi Dan,

thank you for answering me.

The CSV file comes from a Excel's spreadsheet. It has three columns, one for the Aperture Values, one for the Shutter time values and the last one for the Kelvin values.
Every column has 2832 entries (or rows, in other words).

here is an exctract:

Aperture;Shutter;Kelvin
20;0 0.0020000003946255;5850
20;0.001562500102767;5850
20;0.0020000003946255;5850


Return to posts index


Dan Ebberts
Re: Change text from an array on every frame
on Aug 25, 2012 at 6:35:47 pm

With that much data I would use a script to read the file line by line and add text keyframes for each set of values. If you wanted to do it as an expression though, you could paste the data into the expression, something like this (note the triple quotes at the beginning and end of the data):

myStr =
"""20;0.0020000003946255;5850
20;0.001562500102767;5850
20;0.0020000003946255;5850""";
cr = String.fromCharCode(10);
mySplit = myStr.split(cr);
idx = Math.min(timeToFrames(time),mySplit.length-1);
myLine = mySplit[idx];
myData = myLine.split(";");
"Aperature = " + myData[0] + cr + "Time = " + myData[1];


Dan



Return to posts index

Maurizio Costa
Re: Change text from an array on every frame
on Aug 25, 2012 at 7:27:59 pm

Hi Dan ,

thank you for your quick answer.
I will start to work with your code, I will let you to know about the results.

Best regards


Return to posts index

Maurizio Costa
Re: Change text from an array on every frame
on Aug 25, 2012 at 8:02:32 pm

Hi Dan,

it's perfect!

I'm studying the code to understand how it works. thanks for the support.


Return to posts index

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