How to bind your own interfaces before and after rendering in the python extension of omniverse?

I want to do something in my omniverse extension program before and after each frame rendering, such as getting camera information and setting it back. But 1 I can’t find the portal binding before and after rendering, 2 I can’t find the camera’s property acquisition setting interface. Need help

I found capture in the omni.kit.viewport.utility development capture_next_frame_rp_resource_callback The callback interface seems to be what I want. I want to get the rendered content of each frame in the callback function bound by this interface, but the prompt “object has no attribute ‘legacy_window’” is missing. How can I get the “legacy_window”?

Hi @Pitt_Z. The legacy_window attribute is only available on Kit version using the Legacy Viewport. Since Kit 103.5, ViewportNext is now the default. Have a closer look at that omni.kit.viewport.utility module. It also shows the new way of doing the same using ViewportAPI.schedule_capture(). Why don’t you just use the wrapper: omni.kit.viewport.utility.capture_viewport_to_buffer()?

Thank you very much for your reply. At present, the solution is in good working condition.

def on_update(event):
self._capture_viewport()

app = omni.kit.app.get_app()
app.get_update_event_stream().create_subscription_to_pop(on_update, name=‘async rendering test update’)

1 Like