Copy link to clipboard
Copied
Hi,
I'm working on an After Effects plugin using SDK 2017.1 (14.2). The code currently renders using the blocking call AEGP_SetRenderQueueState(AEGP_RenderQueueState_RENDERING). I replace that with the async script call but rendering doesn't start.
I use AEGP_ExecuteScript() to run
app.project.renderQueue.renderAsync();
And then loop waiting for the render state to change to stopped. The script runs, ExecuteScript returns, and my loop starts. Problem is, the loop runs indefinitely and I can see in the After Effects UI that rendering has not started.
What else do I need to do to get renderAsync() to make rendering start? Or is it currently broken? I saw in another post Re: How to Render in AEGP with AE 2015??!! that renderAsync() was blocking in AE 2015.
Thanks!
Posting a short reply to summarize solution...
renderAsync() does work in AE SDK 2017.1. And if you use a loop to wait for rendering to complete, it's also necessary to call PF_AppProgressDialogUpdate to update the UI and so that AEGP_GetRenderQueueState can return 'stopped' when done.
Copy link to clipboard
Copied
Interesting, I don't see any reason why that shouldn't work. Could you email me a drop of your plug-in for the team to investigate further?
Copy link to clipboard
Copied
Hi Zac,
While preparing a build for you that calls renderAsync(), I noticed the behavior was not what I thought initially.
"app.project.renderQueue.renderAsync()" actually does start the rendering. (My mistake!) The After Effects UI is frozen so I can't see it (plugins run in the UI thread?), but the render engine runs and creates the output file. Problem is the value from AEGP_GetRenderQueueState continues to say 'rendering' even after it's done, so my wait loop never exits. After some experimenting, I found a fix for that too: calling PF_AppProgressDialogUpdate inside my wait loop allows the After Effects UI to update and then the value from AEGP_GetRenderQueueState returns to 'stopped'.
Unfortunately, the callbacks I set with AEGP_RegisterListener aren't called, even during the async render.
Copy link to clipboard
Copied
Posting a short reply to summarize solution...
renderAsync() does work in AE SDK 2017.1. And if you use a loop to wait for rendering to complete, it's also necessary to call PF_AppProgressDialogUpdate to update the UI and so that AEGP_GetRenderQueueState can return 'stopped' when done.