Page 1 of 1

Coverting timecode to t value

Posted: April 13th, 2010, 2:01 pm
by cdgary
I have the follwing code for a solid layer

dist = 300;
startPos = [301,240];
linear(time,1.2,1.5,startPos,startPos+[dist,0])

Instead of using the 1.2 and 1.5 parameters in the linear method I would like to use a variable that holds a timecode format and convert the format into t so I can use it in the linear method. See below

dist = 300;
tmin = 0;00;1;03
tmax = 0;00;1;18

tmin_convert = ?
tmax_convert = ?

startPos = [301,240];
linear(time,tmin_convert,tmax_convert,startPos,startPos+[dist,0])


How to I convert tmin and tmax to t values so I can use them in the linear method.?

Re: Coverting timecode to t value

Posted: April 14th, 2010, 12:44 am
by Mylenium
Time is time. I don't really see your problem. If you need to assemble specific strings, then use string methods, for simply converting time to timecode and back use timeToCurrentTimeFormat(), timeTotimecode()etc.

Mylenium

Re: Coverting timecode to t value

Posted: April 16th, 2010, 12:35 pm
by lloydalvarez

Code: Select all

currentFormatToTime(formattedTime, fps, isDuration)
On page 16 of the CS3 scripting guide.

-Lloyd

Re: Coverting timecode to t value

Posted: April 26th, 2010, 5:01 pm
by cdgary
Llody,

in an unrelated topic, I downloaded your 3D layer distributed script and watched your tutorial and I'm fully able to follow your code, but I'm still trying to figure out how you were able to get the little purple squares, which looks like particles to morph into AE TUTS logo. Please Explain?

Thanks!
lloydalvarez wrote:

Code: Select all

currentFormatToTime(formattedTime, fps, isDuration)
On page 16 of the CS3 scripting guide.

-Lloyd