omni.kit.content

class omni.kit.content.ContentWindowWidget

Bases: pybind11_builtins.pybind11_object

class omni.kit.content.IContentUi

Bases: pybind11_builtins.pybind11_object

create_content_window_widget(self: omni.kit.content._content.IContentUi, width: int = 800, height: int = 340) → omni.kit.content._content.ContentWindowWidget

Creates content window widget.

Parameters
  • width – Width in pixel.

  • height – Height in pixel.

Returns

ContentWindowWidget instance.

destroy_content_window_widget(self: omni.kit.content._content.IContentUi, widget: omni.kit.content._content.ContentWindowWidget)None

Destroys content window widget.

Parameters

widget – ContentWindowWidget instance to be destroyed.

draw_content_window_widget(self: omni.kit.content._content.IContentUi, widget: omni.kit.content._content.ContentWindowWidget, elapsed_time: float)None

Draws content window widget.

Parameters
  • widget – ContentWindowWidget instance to be drawn.

  • elapsed_time – Time in seconds since last draw.

get_content_window(self: omni.kit.content._content.IContentUi, handle: omni::kit::_ExtensionWindow = None) → omni.kit.content._content.IContentWindow

Gets a ContentWindow instance from its ExtensionWindowHandle.

Parameters

handle – The ExtensionWindowHandle for the Window. Pass None to get the first available viewport (in creation order).

Returns

ContentWindow instance associated with the ExtensionWindowHandle.

refresh_content_window_widget(self: omni.kit.content._content.IContentUi, widget: omni.kit.content._content.ContentWindowWidget)None

Refreshes content window widget.

Parameters

widget – ContentWindowWidget instance to be refreshed.

class omni.kit.content.IContentWindow

Bases: pybind11_builtins.pybind11_object

add_context_menu(self: omni.kit.content._content.IContentWindow, menu_path: str, tooltip: str, on_click: Callable[[str, bool], None]) → carb._carb.Subscription

Add context menu item to content window.

Parameters
  • menu_path – The name to the menu (e.g. “Open”), this name must be unique across context menu.

  • tooltip – The helper text.

  • on_click – The callback function called when menu item is clicked.

Returns

Subscription object used to remove added context menu.

add_icon_menu(self: omni.kit.content._content.IContentWindow, menu_path: str, on_click: Callable[[str, bool], None], on_check: Callable[[str], bool] = None) → carb._carb.Subscription

Add Icon menu item to content window.

Parameters
  • The name to the menu (menu_path) –

  • The callback function called when menu item is clicked. (on_click) –

  • The callback function called when menu item is created. Should return false to hide the menu. (on_check) –

Returns

Subscription object used to remove added icon menu.

add_tool_button(self: omni.kit.content._content.IContentWindow, name: str, tooltip: str, valid_data_source: bool, on_click: Callable[[str], None], priority: int = 0) → carb._carb.Subscription

Adds tool button for content window, which locates at the left of search bar.

Parameters
  • name – The name of the button, this name must be unique across tool bar of content window.

  • tooltip – The helper text.

  • valid_data_source – If this is true, the button will only be enabled when a valid data source is selected.

  • on_click – The callback function called when button is clicked.

  • priority – The priority to sort tool buttons. It’s sorted in ascending order.

Returns

Subscription object used to remove added tool button.

get_selected_directory_path(self: omni.kit.content._content.IContentWindow)str

Gets current selected directory in content window.

Returns

/test/”).

Return type

Current selected directory in content window, (e.g. “/Users/test/”, or “E

get_selected_icon_path(self: omni.kit.content._content.IContentWindow)str

Gets current selected icon in content window.

Returns

/test/1.usd”).

Return type

Current selected icon in content window, (e.g. “/Users/test/1.usd”, or “E

get_selected_icon_protocol(self: omni.kit.content._content.IContentWindow)str

Gets current selected icon protocol in content window.

Returns

” for local, or “omniverse:” for OV).

Return type

Current selected icon protocol in content window, (e.g. “file

get_selected_path_protocol(self: omni.kit.content._content.IContentWindow)str

Gets current selected path protocol in content window.

Returns

” for local, or “omniverse:” for OV).

Return type

Current selected path protocol in content window, (e.g. “file

navigate_to(self: omni.kit.content._content.IContentWindow, path: str, change_selection: bool)None

Navigates to a path.

Parameters
  • path – The path to navigate to.

  • change_selection – True: the path’s parent directory will be expanded and leaf selected. False: the path itself will be expanded and nothing will be selected

refresh(self: omni.kit.content._content.IContentWindow)None

Refresh selected node of content window.

property visible
omni.kit.content.acquire_content_ui_interface(plugin_name: str = None, library_path: str = None) → omni::kit::IContentUi
omni.kit.content.get_content_ui_interface() → omni.kit.content._content.IContentUi

Returns cached omni.kit.IContentUi interface

omni.kit.content.get_content_window(handle=None) → omni.kit.content._content.IContentWindow

Returns cached omni.kit.IContentWindow interface

Parameters

ExtensionWindowHandle for the Window. Pass None to get the first available content window (The) –

omni.kit.content.release_content_ui_interface(arg0: omni::kit::IContentUi)None