SingleCameraMenuItemBase#

class omni.kit.viewport.menubar.camera.SingleCameraMenuItemBase(
camera_path: Path,
viewport_api: ViewportAPI,
lock_model: AbstractValueModel,
root: Menu,
triggered_fn: Callable,
widget_delegate_manager: CameraWidgetDelegateManager,
hotkey_text: str = '',
show_hotkey_placeholder: bool = False,
)#

Bases: MenuItem

A base class for creating custom single camera menu items.

Methods

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

A base class for creating custom single camera menu items.

destroy()

Removes all the callbacks and circular references.

set_checked(checked)

Set menu state to be checked

Attributes

camera_path

Path to camera

viewport_api

Viewport API

__init__(
camera_path: Path,
viewport_api: ViewportAPI,
lock_model: AbstractValueModel,
root: Menu,
triggered_fn: Callable,
widget_delegate_manager: CameraWidgetDelegateManager,
hotkey_text: str = '',
show_hotkey_placeholder: bool = False,
)#

A base class for creating custom single camera menu items.

Parameters:
  • camera_path (Sdf.Path) – Path to camera.

  • viewport_api (ViewportAPI) – Viewport API.

  • lock_model (ui.AbstractValueModel) – Value model to indicate if camera locked.

  • root (ui.Menu) – Root menu.

  • triggered_fn (Callable) – Callback when men item clicked.

  • widget_delegate_manager (CameraWidgetDelegateManager) – Manager to custom button/menu item delegates.

Keyword Arguments:
  • hotkey_text (str) – Hotkey text. By default “” means no hotkey text displayed.

  • show_hotkey_placeholder (bool) – If show placeholder for hotkey in menu item. Default False.

destroy()#

Removes all the callbacks and circular references.

set_checked(checked: bool) None#

Set menu state to be checked

property camera_path: Path#

Path to camera

property viewport_api: ViewportAPI#

Viewport API