omni.kit.window.file_exporter

A standardized dialog for exporting files

class omni.kit.window.file_exporter.FileExporterExtension

Bases: IExt

A Standardized file export dialog.

add_export_options_frame(name: str, delegate: DetailFrameController)

Adds a set of export options to the dialog. Should be called after show_window.

Parameters
  • name (str) – Title of the options box.

  • delegate (ExportOptionsDelegate) – Subclasses specified delegate and overrides the _build_ui_impl method to provide a custom widget for getting user input.

click_apply(filename_url: Optional[str] = None, postfix: Optional[str] = None, extension: Optional[str] = None)

Helper function to progammatically execute the apply callback. Useful in unittests

click_cancel(cancel_handler: Optional[Callable[[str, str], None]] = None)

Helper function to progammatically execute the cancel callback. Useful in unittests

destroy_dialog()
detach_from_main_window()

Detach the current file importer dialog from main window.

hide_window()

Hides and destroys the dialog window.

property is_ui_ready: bool
property is_window_visible: bool
on_shutdown()
on_startup(ext_id)
async select_items_async(url: str, filenames: List[str] = []) List[FileBrowserItem]

Helper function to programatically select multiple items in filepicker. Useful in unittests.

show_window(title: Optional[str] = None, width: int = 1080, height: int = 450, show_only_collections: Optional[List[str]] = None, show_only_folders: bool = False, file_postfix_options: Optional[List[str]] = None, file_extension_types: Optional[List[Tuple[str, str]]] = None, export_button_label: str = 'Export', export_handler: Optional[Callable[[str, str, str, List[str]], None]] = None, filename_url: Optional[str] = None, file_postfix: Optional[str] = None, file_extension: Optional[str] = None, should_validate: bool = False, enable_filename_input: bool = True)

Displays the export dialog with the specified settings.

Keyword Arguments
  • title (str) – The name of the dialog

  • width (int) – Width of the window (Default=1250)

  • height (int) – Height of the window (Default=450)

  • show_only_collections (List[str]) – Which of these collections, [“bookmarks”, “omniverse”, “my-computer”] to display.

  • show_only_folders (bool) – Show only folders in the list view.

  • file_postfix_options (List[str]) – A list of filename postfix options. Nvidia defaults.

  • file_extension_types (List[Tuple[str, str]]) – A list of filename extension options. Each list element is a (extension name, description) pair, e.g. (“.usdc”, “Binary format”). Nvidia defaults.

  • export_button_label (str) – Label for the export button (Default=”Export”)

  • export_handler (Callable) – The callback to handle the export. Function signature is export_handler(filename: str, dirname: str, extension: str, selections: List[str]) -> None

  • filename_url (str) – Url of the target file, excluding filename extension.

  • file_postfix (str) – Sets selected postfix to this value if specified.

  • file_extension (str) – Sets selected extension to this value if specified.

  • should_validate (bool) – Whether filename validation should be performed.

  • enable_filename_input (bool) – Whether filename field input is enabled, default to True.

omni.kit.window.file_exporter.get_file_exporter() FileExporterExtension

Returns the singleton file_exporter extension instance