I'm creating an AEGP that needs to check flags and in/out of all layers in the active comp continuously. I loop through my layers in my IdleHook, and since there's no heavy processing (almost none if nothing has changed) it seems to work well without affecting performance much. It would be great if I could track whenever the timeline has been manipulated, if user is done dragging a layer or manipulates layer flags, but as far as I understand, this is not possible with the SDK?
Anyway my real problem is that I need to check the layers in the active Timeline. Right now I use AEGP_GetActiveItem to get the comp and it works perfectly, until I click the lock for the view of one comp and switch to another timeline. Now AEGP_GetActiveItem will still get the locked comp seen in the Viewer, even though active Timeline has changed. Is there any way to know what comps are currently open in timeline tabs, or even better get the comp of the active timeline?
Any help would be very appreciated!
Thanks in advance
sorry, but no great news...
regarding time change command notifications,
i don't know if there's such an event, because the commands are not listed anywhere. (you have to contact adobe and ask)
but you can experiment and see!
use AEGP_RegisterCommandHook with AEGP_Command_ALL, and see if you get calls during time changes.
(it's might take some time to filter out other calls...)
as for telling what timeline is active...
i don't know of a direct way.
otherwise... i honestly don't know.
Trivia: Not even AE can do everything when you are in a different timeline from what you see. For example, you can't right click and choose easy ease etc.
Thanks a lot anyway!
Sorry, a couple of more questions. First of all, do we know anything about command numbers? Such as the range(s) they are in? I know I can ask the API guys for this but I would like to experiment a little on my own first.
Secondly: Is it possible to put an AEGP command in the Layer -> New submenu, below the standard layer types? Actually I'm mostly interested in the popup you get when you right click the timeline, and choose New.
command numbers start from 1, and end... i don't know where.
i saw commands with a number as high as 5000. so we're probably talking thousands and not millions.
as for the sub menu, if it's not listed as an AEGP_MenuID, then i'm guessing that you can't put it there.
you can with a lot (really a lot) of effort get hold of the main window handle for AE, and add items directly to it (a friend of mine did that a while ago), but i'm not sure how you could track down the "new" menu, or how you can then link that entry to your AEGP...
I've found a workaround for this problem with finding the active timeline when another comp is locked. It works well for some purposes. First deselect all project items, i did this using
AEGP_SelectItem(first_item, false, true)). Then run AEGP_DoCommand(3696) (reveal comp in project) before you try to get the active timeline using AEGP_GetActiveItem. The side effect is that the comp is selected in the project view. If this is ok for you it seems to work fine.
I tried saving the selection in an array and then setting it back afterwards. It works but is very slow using AEGP_SelectItem. I tried a project with 20 items, it was pretty ugly, one selected at a time pretty slowly. I haven't found a better ways of manipulating item selections, do you know any? Would be nice to have something like layer collections..
i think there's a way to set the selection of multiple object
you create a new collection using AEGP_NewCollection,
add objects to it using AEGP_CollectionPushBack,
and set it using AEGP_SetSelection.