FileExporterExtension#

class omni.kit.window.file_exporter.FileExporterExtension#

Bases: IExt

A Standardized file export dialog.

Methods

__init__(self)

add_export_options_frame(name, delegate)

Adds a set of export options to the dialog.

click_apply([filename_url, postfix, extension])

Helper function to progammatically execute the apply callback.

click_cancel([cancel_handler])

Helper function to progammatically execute the cancel callback.

destroy_dialog()

detach_from_main_window()

Detach the current file importer dialog from main window.

hide_window()

Hides and destroys the dialog window.

on_shutdown()

on_startup(ext_id)

select_items_async(url[, filenames])

Helper function to programatically select multiple items in filepicker.

show_window([title, width, height, ...])

Displays the export dialog with the specified settings.

Attributes

is_ui_ready

is_window_visible

__init__(
self: omni.ext._extensions.IExt,
) None#
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: str = None,
postfix: str = None,
extension: str = None,
)#

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

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

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

detach_from_main_window()#

Detach the current file importer dialog from main window.

hide_window()#

Hides and destroys the dialog window.

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: str = None,
width: int = 1080,
height: int = 450,
show_only_collections: List[str] = None,
show_only_folders: bool = False,
file_postfix_options: List[str] = None,
file_extension_types: List[Tuple[str, str]] = None,
export_button_label: str = 'Export',
export_handler: Callable[[str, str, str, List[str]], None] = None,
filename_url: str = None,
file_postfix: str = None,
file_extension: str = None,
should_validate: bool = False,
enable_filename_input: bool = True,
focus_filename_input: bool = True,
click_cancel_handler: Callable[[str, str], None] = None,
)#

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, filename is the name of the file, and dirname being the containing directory path with an ending slash. 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.

  • click_cancel_handler (Callable[[str, str], None]) – The callback to handle click of the cancel button.