Copy link to clipboard
Copied
Hi,
I have set the flags PF_OutFlag2_SUPPORTS_THREADED_RENDERING, PF_OutFlag2_I_USE_3D_CAMERA, and PF_OutFlag2_SUPPORTS_QUERY_DYNAMIC_FLAGS in global setup.
When the camera position is updated, I retrieve the updated camera info and send it to another app using a WebSocket. As soon as I receive updated info from the other app based on the camera update, I want to call render again to update the info on my UI.
However, this procedure is very slow because the render function is called for every frame, and it tries to gather camera info for every frame, even though the camera info is the same. Is there any other command or trigger that gets hit when the camera info is updated that I can use to optimize my plugin?
Thankyou
Copy link to clipboard
Copied
where exactly is the slowdown? is it the AE calls for pre-render, the fetching of the camera info, or the round trip of your API?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
i doubt the pre-render calls cause a slowdown. many plugins get pre-render calls for any change in the comp and it doesn't seem to slow anything down.
by "fetching camera info" do you mean getting it from AE< to sending it to the websocket (and possibly waiting for a reply)?
as for telling what changed in the camera, there's no aPI for that. you can cache the camera info you had on the previous pre-render call for the same time sample and compare. you can also cache just the camera matrix, which encapsulates all the camera transformation info, and then decide whether or not you should get the full data.
Copy link to clipboard
Copied