• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Get updated camera info

Explorer ,
Mar 04, 2023 Mar 04, 2023

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

TOPICS
How to , SDK

Views

346

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 05, 2023 Mar 05, 2023

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 05, 2023 Mar 05, 2023

Copy link to clipboard

Copied

Both the AE calls for pre-render and the fetching of the camera info are
causing some slowdown.
I've set the PF_OutFlag_WIDE_TIME_INPUT as I want the render to be called
multiple times in some other case, but while sending camera info, I want
the render to be called only once.
Can I change the outflag somewhere in between.

Also, I would like to know if there is a way to know when the camera is
updated and what part of the camera is updated.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 05, 2023 Mar 05, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 05, 2023 Mar 05, 2023

Copy link to clipboard

Copied

LATEST
Thanks for your answer. Caching the camera info would solve one of my
problems to get the updated camera info.
But it would be more helpful if there can be a way to make a render call
just once and not for every frame.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines