Before I capture, I would like to change to position and direction of the camera. This is how I do that:
viewportWindow.set_camera_position(cameraPath, 0, 0, 5, True)
viewportWindow.set_camera_target(cameraPath, 0, 0, 0, True)
That works fine, but when I capture the next frame, I still get an image from the old position, because I have to wait for the viewport update.
But that does not work. How can I wait for the viewport update after changing camera parameter?
And what about the raytracing state? Is there a way to wait for finishing the current image (later I would like to switch to iray for capturing images, so I have to wait for the ray tracing).
instead of calling next_update_async I added a sleep(5) to wait for 5 seconds… but event that, does not change anything… only the second render request is created with the updates camera parameters - reagardless of the waiting duration.
Here is the full code: @router.post(“/render”, description=“Renders a session”, summary=“Renders the current session from a specified camera”)
async def post_render(data: dict = fastapi.Body(None)):
renderer = omni.renderer_capture.acquire_renderer_capture_interface()