Extension: omni.kit.viewport.utility-2.0.1

Documentation Generated: Nov 13, 2025

Overview#

omni.kit.viewport.utility provides utility functions for accessing and managing viewport information within Omniverse Kit. This extension serves as a centralized toolkit for querying active viewports, retrieving camera information, capturing viewport content, and controlling viewport behavior across different USD contexts and windows.

Functionality#

Viewport Discovery and Access#

Retrieving viewports by context or window name. The extension provides functions to locate viewports using different criteria - by USD context name, window name, or both. Functions like [get_active_viewport](omni.kit.viewport.utility/omni.kit.viewport.utility.get_active_viewport)() and [get_viewport_from_window_name](omni.kit.viewport.utility/omni.kit.viewport.utility.get_viewport_from_window_name)() allow developers to access specific viewport instances programmatically.

Active viewport detection. The [get_active_viewport_and_window](omni.kit.viewport.utility/omni.kit.viewport.utility.get_active_viewport_and_window)() function returns both the active viewport API instance and its corresponding window, making it easy to work with viewport-window pairs in applications that manage multiple viewports.

Camera Information Access#

Camera path retrieval. Functions like [get_viewport_window_camera_path](omni.kit.viewport.utility/omni.kit.viewport.utility.get_viewport_window_camera_path)() and [get_active_viewport_camera_path](omni.kit.viewport.utility/omni.kit.viewport.utility.get_active_viewport_camera_path)() provide access to the camera paths being used by specific viewports, returning either Sdf.Path objects or string representations of the camera paths.

Cross-context camera queries. The extension supports querying camera information across different USD contexts, enabling applications to work with multiple stages simultaneously.

Viewport Content Capture#

Buffer and file capture. The extension provides both [capture_viewport_to_buffer](omni.kit.viewport.utility/omni.kit.viewport.utility.capture_viewport_to_buffer)() and [capture_viewport_to_file](omni.kit.viewport.utility/omni.kit.viewport.utility.capture_viewport_to_file)() functions for capturing viewport content. These functions support both HDR and LDR capture modes and return future-like objects for asynchronous operations.

Flexible capture options. Capture functions accept format descriptors and render product paths, allowing developers to specify custom capture settings and target specific rendering outputs.

Prim Framing#

Viewport framing operations. Functions like [frame_viewport_prims](omni.kit.viewport.utility/omni.kit.viewport.utility.frame_viewport_prims)() and [frame_viewport_selection](omni.kit.viewport.utility/omni.kit.viewport.utility.frame_viewport_selection)() automatically adjust the camera to frame specific primitives or the current selection within the viewport.

Viewport Control and Configuration#

AOV management. The extension provides functions for working with Arbitrary Output Variables (AOVs), including [add_aov_to_viewport](omni.kit.viewport.utility/omni.kit.viewport.utility.add_aov_to_viewport)() for adding AOVs to specific viewports.

Message posting. The [post_viewport_message](omni.kit.viewport.utility/omni.kit.viewport.utility.post_viewport_message)() function enables posting toast notifications directly to viewports or viewport windows.

Viewport creation. The [create_viewport_window](omni.kit.viewport.utility/omni.kit.viewport.utility.create_viewport_window)() function allows programmatic creation of new viewport windows with customizable dimensions, position, and camera settings.

Interaction Control#

Selection and context menu management. Functions like [disable_selection](omni.kit.viewport.utility/omni.kit.viewport.utility.disable_selection)() and [disable_context_menu](omni.kit.viewport.utility/omni.kit.viewport.utility.disable_context_menu)() return context manager objects that temporarily disable these features and automatically restore them when the objects go out of scope.

Drop helper creation. The [create_drop_helper](omni.kit.viewport.utility/omni.kit.viewport.utility.create_drop_helper)() function creates objects for managing drag-and-drop operations within viewports.