Coverting timecode to t value

Moderators: Disciple, zlovatt

Post Reply
cdgary
Posts: 4
Joined: April 12th, 2010, 6:24 pm

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.?
Mylenium
Posts: 139
Joined: July 20th, 2005, 12:07 am

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
[Pour Mylène, ange sur terre]
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

Code: Select all

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

-Lloyd
cdgary
Posts: 4
Joined: April 12th, 2010, 6:24 pm

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
Post Reply