inPoint, outPoint, duration problems

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
lougris
Posts: 12
Joined: March 12th, 2012, 5:29 am

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
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

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.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

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.
lougris
Posts: 12
Joined: March 12th, 2012, 5:29 am

Thanx a lot, i will look to this currentFormatToTime() global method
Post Reply