Skip to main content
Inspiring
March 14, 2024
Answered

How to get the current playhead time in an AEGP plugin?

  • March 14, 2024
  • 1 reply
  • 223 views

I'm writing an AEGP plugin, and would like to determine the current time of the playhead. Do you know if there is a function for that in the SDK? I've been looking for about 20 minutes, and can't find it. Thanks!

Correct answer jamesastro

Aha! I figured it out. Here is some code that shows how to do it:

 

suites.ItemSuite6()->AEGP_GetActiveItem(&item);

suites.ItemSuite6()->AEGP_GetItemType(item, &itemType);

 

if (itemType == AEGP_ItemType_COMP) {

     suites.ItemSuite9()->AEGP_GetItemCurrentTime(item, &time);

}

 

1 reply

jamesastroAuthorCorrect answer
Inspiring
March 15, 2024

Aha! I figured it out. Here is some code that shows how to do it:

 

suites.ItemSuite6()->AEGP_GetActiveItem(&item);

suites.ItemSuite6()->AEGP_GetItemType(item, &itemType);

 

if (itemType == AEGP_ItemType_COMP) {

     suites.ItemSuite9()->AEGP_GetItemCurrentTime(item, &time);

}

 

Inspiring
August 7, 2025

Just a note if someone is looking for this, the time won't update while rendering, meaning during playback this function will not return the current CTI position until the playback stops.

 

Also AEGP_GetLayerCurrentTime might be a better option if you want the time relative to a specific layer instead of the comp.