Skip to main content
Inspiring
Mar 14, 2024 10:40 PM UTC
Answered

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

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!

jamesastroCorrect answer
Inspiring
Mar 15, 2024 12:09 AM UTC

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);

}

 

2 replies

jamesastroAuthorCorrect answer
Inspiring
Mar 15, 2024 12:09 AM UTC

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);

}

 

Translate
Inspiring
Aug 7, 2025 5:07 PM UTC

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.

Translate