Skip to main content
Participant
November 16, 2007
Question

After Effects time representation

  • November 16, 2007
  • 1 reply
  • 1399 views
Hi all,

Would anyone be able to point me in the direction of a document which explains how time works in After Effects plugins? I'm writing a plugin and want to get access to each frame. I'm finding the A_Time type a little confusing - what does it actually represent? I have the frame duration (using RenderOptionsSuite3()->AEGP_GetTimeStep()) and want to step through each frame using RenderOptionsSuite3()->AEGP_SetTime().

Thanks,
Andrew
This topic has been closed for replies.

1 reply

Participating Frequently
November 16, 2007
Here's how I did it:

int frameStep = in_data->time_step;
int curFrame = (in_data->current_time+frameStep/2) / frameStep;
int numFrames = (in_data->total_time+frameStep/2) / frameStep;
double framesPerSec = double(in_data->time_scale) / double(frameStep);

Now curFrame and numFrames represent current frame nr and total number of frames. If you need the current time in seconds, that would be curFrame/framesPerSec.

(the +frameStep/2 things are for cleaner rounding, probably not even necessary).