Skip to main content
Participating Frequently
July 23, 2015
Question

IdleHook not called while animation is running

  • July 23, 2015
  • 1 reply
  • 818 views

I was surprised, though it makes sense because it is, after all, named idle.

Is there no way to register a callback that gets called every frame, whether animation is running or not? You know, a standard update function.

If not, does it mean I have to use an OS-dependent event loop? (is this even possible? will AE behave properly if I get streams, keyframes, insert keyframes, etc., outside of its callbacks?)

This topic has been closed for replies.

1 reply

Community Expert
July 23, 2015

even if you use an os specific event loop, you still need to interact with

AE during some call to your plug-in.

i don't know of an AEGP hook that gets called when a frame gets rendered.

but obviously effects get a render call when a frame is rendered...

if you're looking for a UI update while a ram preview is running, then i

don't think it's possible, as AE doesn't display the ui overlay during

previews.

Participating Frequently
July 23, 2015

I need to get and set keyframe data while animations are running (I am not that familiar with AE terminology, is Play not just a preview, rather than an actual render?)

I know that an effect can do this, but I need to do things also when the user isn't running the animation, so an effect is too limited.

Can I do some weird AEGP + Effect combo to handle both cases? and if so, how does data sharing between the two work?

françois leroy
Inspiring
July 23, 2015

Hi Spectralcanine (nice name!)

I'm actually doing the same kind of stuff, and it's a difficult route, specially with CC 2015...

The process I followed is like this:

1_the layer effect sends data to the AEGP with custom suite (like this you can use your own struct and pass anything you like)

2_on idleHook, the AEGP performs what is forbidden to do during a render call (for example)

Now, the tricky part is if you try to do it during Ram preview, cos' it's no idle time for AE...

Also, if the operation's too long you might want to stop it...

You can have a look at this thread, where Shacchar helped me find a way to do it:

PF_ABORT and PF_Cmd_USER_CHANGED_PARAM

For the Ram preview problem, I must say I'm stuck too...

I've tried using ExecuteScript(), but it sends me an alert (strange cos if a ram preview is running and I manually launch a script, it works)

If anyone has a clue, I'm interested too!

Hope it helps!

Cheers,

François