Copy link to clipboard
Copied
Hello!
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
Petter Bergmar
Copy link to clipboard
Copied
err...
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.
what about javascript? if a script gets the active timeline and not the viewed comp, then you can use EXECUTE_SCRIPT(), to retrieve the result.
otherwise... i honestly don't know.
😞
Copy link to clipboard
Copied
Ok thanks. The good new is, then I was going in the right direction. I'm actually currently amazed by how fast i can loop through all layers of all comps. Even with 50 comps with 300 layers in each, I don't see a performance hit when checking it all in the IdleHook. So I think I will go with that for now, will double check JavaScript though and see if it behaves differently.
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!
Petter
Copy link to clipboard
Copied
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.
Thanks
Copy link to clipboard
Copied
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...
so...
yeah.
Copy link to clipboard
Copied
The menu thing would've been nice but is definitely not important, so I'll do without it.
Thanks!!
Copy link to clipboard
Copied
slowly breaking your spirit...
good... good...
Copy link to clipboard
Copied
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.
Petter
Copy link to clipboard
Copied
nice!!!!
can you keep the old selection and re-apply it?
would that reconstruct the previous window state?
Copy link to clipboard
Copied
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..
Copy link to clipboard
Copied
i think there's a way to set the selection of multiple object
simultaniously.
you create a new collection using AEGP_NewCollection,
add objects to it using AEGP_CollectionPushBack,
and set it using AEGP_SetSelection.
no?
Copy link to clipboard
Copied
Yes but this is only for layers in comps right? The selection I'm talking about is items in the project window. Maybe I'm missing something?
Copy link to clipboard
Copied
i think you're right.
i think it applies only to comp elements.
we'll it was fun anyways.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now