ViewportWidget#

class omni.kit.widget.viewport.ViewportWidget(
usd_context_name: str = '',
camera_path: str | None = None,
resolution: tuple | None = None,
hd_engine: str | None = None,
viewport_api: ViewportAPI | str | None = None,
hydra_engine_options: dict | None = None,
**ui_kwargs,
)#

Bases: object

A low level omni.ui.Widget for displaying rendered output.

Methods

__init__([usd_context_name, camera_path, ...])

ViewportWidget constructor

destroy()

Called by extension before destroying this object.

get_instances()

Return an iterable object to enumerate all known ViewportWidget instances

set_resolution(resolution)

Attributes

display_delegate

expand_viewport

Whether the ui object containing the Viewport texture expands one dimension of resolution to cover the full ui size

fill_frame

Whether the ui object containing the Viewport texture expands both dimensions of resolution based on the ui size

full_resolution

Return the resolution being requested (not accounting for any % down-scaling

name

Return the name of the ViewportWidget

resolution

Return the resolution that the renderer is providing images at.

resolution_uses_dpi

Whether to account for DPI when driving the Viewport texture resolution

usd_context_name

Return the name of the USdContext this instance is attached to

viewport_api

Return the active omni.kit.widget.viewport.ViewportAPI for the ViewportWidget

visible

Set the visibility of this ViewportWidget

__init__(
usd_context_name: str = '',
camera_path: str | None = None,
resolution: tuple | None = None,
hd_engine: str | None = None,
viewport_api: ViewportAPI | str | None = None,
hydra_engine_options: dict | None = None,
**ui_kwargs,
)#

ViewportWidget constructor

Parameters:
  • usd_context_name (str) – The name of a UsdContext this Viewport will be viewing.

  • camera_path (str) – The path to a UsdGeom.Camera to render with.

  • resolution – (x,y): The size of the backing texture that is rendered into (or ‘fill_frame’ to lock to UI size).

  • viewport_api – (ViewportAPI, str) A ViewportAPI instance that users have access to via .viewport_api property or a unique string id used to create a default ViewportAPI instance.

destroy()#

Called by extension before destroying this object. It doesn’t happen automatically. Without this hot reloading doesn’t work.

static get_instances()#

Return an iterable object to enumerate all known ViewportWidget instances

property expand_viewport: bool#

Whether the ui object containing the Viewport texture expands one dimension of resolution to cover the full ui size

property fill_frame: bool#

Whether the ui object containing the Viewport texture expands both dimensions of resolution based on the ui size

property full_resolution#

Return the resolution being requested (not accounting for any % down-scaling

property name#

Return the name of the ViewportWidget

property resolution: Tuple[float, float]#

Return the resolution that the renderer is providing images at.

property resolution_uses_dpi: bool#

Whether to account for DPI when driving the Viewport texture resolution

property usd_context_name: str#

Return the name of the USdContext this instance is attached to

property viewport_api#

Return the active omni.kit.widget.viewport.ViewportAPI for the ViewportWidget

property visible#

Set the visibility of this ViewportWidget