Page 1 of 1

inPoint, outPoint, duration problems

Posted: March 13th, 2012, 8:32 am
by lougris
Hello,

I'm nut used to write in english, so excuse me.

I just start to use After Effects scripting since few days,

I have a problem and i'm surprised to discover that when i set #inPoint or outPoint values of an imported footage in a script,

result values are different because there is a cast from hh:mm:ss:ff time to a time in seconds (max 10800.0), the .ff is bad converted in seconds so that the final result is wrong.


example : 11.18 is converted in 11.04 (because 18 is considered as milliseconds)


Is there a solution to solve this with an existing method from the framework?

Could we convert a time give by an user in the hh.mm.ss.ff format to a time in seconds format with an existing method?


I also have problems with duration, with the addComp(name,width,height,pixelAspect,duration,frameRate) method, when i set duration in methods parameters, the result is equal the result-1f.

But if i set it directly to the comp, it's correct.


See you


Thanks for advance.


Frédéric

Re: inPoint, outPoint, duration problems

Posted: March 15th, 2012, 8:59 am
by byronnash
I'm not sure I understand your question exactly but I will offer this. Time is expressed in seconds, not timecode. You must multiply by the frame duration of the comp to get the correct times.

Re: inPoint, outPoint, duration problems

Posted: March 15th, 2012, 1:38 pm
by Paul Tuersley
There is also the currentFormatToTime() global method for converting from timecode to seconds. See page 16 of the CS3 Scripting Guide pdf.

And if necessary you can check and alter the time display type (timecode, frames) using the Project object's timecodeDisplayType atribute (page 116)

It can be tricky setting durations accurately with scripting, and there are quite a few posts about it on this forum. It's probably best if you post a specific example of your problem if we're going to get into that.

Re: inPoint, outPoint, duration problems

Posted: March 16th, 2012, 2:44 am
by lougris
Thanx a lot, i will look to this currentFormatToTime() global method