capture_viewport_to_file#
- omni.kit.viewport.utility.capture_viewport_to_file(
- viewport_api,
- file_path: str | Sequence[str] = None,
- is_hdr: bool = False,
- render_product_path: str = None,
- format_desc: dict = None,
- frame_to_capture=None,
Capture the provided viewport to a file.
- Parameters:
viewport_api (ViewportAPI) – The viewport API instance to capture.
file_path (str, optional) – The file path where the captured image will be saved. If not specified, a default path is used.
is_hdr (bool, optional) – If True, captures the HDR buffer; otherwise, captures the LDR buffer. Defaults to False.
render_product_path (str, optional) – Render product path to use for capturing. Defaults to None.
format_desc (dict, optional) – A dictionary describing the format in which to save the captured image. Defaults to None.
frame_to_capture (int, optional) – A specific SWH frame number to capture. Defaults to None.
- Returns:
A future-like object that can be awaited to ensure the capture completes.