Python sample code to render the current frame in RTX

I need a sample python code to how to render the current frame using RTX and save it to a png/jpg file.

Here is a good sample code for capturing the render and saving it to disk.
test_capture_png.py (16.5 KB)

1 Like

Crossposting from the discord for visiblity. While i could get this to work for rendering a single image or sequence i could not get it to render multiple cameras in a single operation. Here is reduced sample code: render automation example - PasteJustit.com

It only ever renders the second image and the first one never gets written and the check times out after the set 30s.

Any pointers? I would even prefer this to not be asyncronously if that is possible.

I managed to solve this (thanks to Bob White @NVIDIA!) by wrapping the call to my render function in an additional async wrapper that awaits my function, calls another wait_n_updates in between and also makes sure to prevent garbage collection of the ensure_future call.

Great to hear!