AbstractWidgetDelegate#

class omni.kit.viewport.menubar.camera.AbstractWidgetDelegate#

Bases: ABC

A base class for creating custom widgets in camera button and camera menu item.

Methods

build_widget(parent_id, viewport_api, ...)

Builds widget.

destroy()

Release resources.

on_camera_path_changed(parent_id, camera_path)

Callback when the tracked camera has changed.

on_parent_destroyed(parent_id)

Called before the destroy of the parent widget to release the bound resources specific to the parent.

Attributes

order

The order of the widget relative to the right of camera label.

__init__()#
abstract build_widget(
parent_id: int,
viewport_api: ViewportAPI,
camera_path: Path,
) → Widget | None#

Builds widget. This must be overridden to provide the layout.

Parameters:
  • parent_id (int) – It’s unique id of the camera item, with which you can use to manage the camera widget.

  • viewport_api (ViewportAPI) – Viewport interface.

  • camera_path (Sdf.Path) – The camera path to build widget for.

destroy()#

Release resources.

abstract on_camera_path_changed(
parent_id: int,
camera_path: Path,
)#

Callback when the tracked camera has changed.

Parameters:
  • parent_id (int) – It’s unique id of the camera item, with which you can use to manage the camera widget.

  • camera_path (Sdf.Path) – The new camera path.

abstract on_parent_destroyed(parent_id: int) → None#

Called before the destroy of the parent widget to release the bound resources specific to the parent.

Parameters:

parent_id (int) – It’s unique id of the camera item, with which you can use to manage the camera widget.

property order: int#

The order of the widget relative to the right of camera label. The lower the order number, the closer the widget to the camera label.