get_active_viewport_window#

omni.kit.viewport.utility.get_active_viewport_window(
window_name: str = None,
wrap_legacy: bool = True,
usd_context_name: str = '',
)#

Retrieves the active viewport window, optionally for a specified USD context and window name.

Parameters:
  • window_name (str, optional) – The name of the window to query. If none is provided, defaults to the viewport window name from settings.

  • wrap_legacy (bool, optional) – Flag to determine if a legacy viewport should be wrapped.

  • usd_context_name (str, optional) – The name of the USD context to query. If empty, the current USD context is used.

Returns:

The active viewport window instance or None if not found.

Return type:

Optional[Window]