file_path
stringlengths
5
148
content
stringlengths
0
526k
omni.kit.window.file.FileWindowExtension.md
# FileWindowExtension ## Methods - **add_reference(is_payload)** - Prompt for the file to add reference or payload to. - **close(on_closed, fast_shutdown)** - Check if current stage is dirty. - **create_stage(edit_layer_path, file_path, ...)** - Create a stage with edit layer from paths. - **new(template)** - Create a new USD stage. - **on_shutdown()** - Cleanup the extension. - **on_startup(ext_id)** - Initialize the extension. | Method | Description | | ------ | ----------- | | `open` ([open_loadset]) | Bring up a file picker to choose a USD file to open. | | `open_stage` (path[, open_loadset, open_options]) | Open stage. | | `open_with_new_edit_layer` (path[, ...]) | Open stage and create a new edit layer. | | `post_notification` ([info, duration]) | Post a notification message. | | `prompt_if_unsaved_stage` (callback) | Check if current stage is dirty. | | `register_open_stage_addon` (callback) | Register callback to call when opening a stage. | | `register_open_stage_complete` (callback) | Register callback to call when finish opening a stage. | | `reopen` () | Reopen currently opened stage. | | `save` (callback[, allow_skip_sublayers, ...]) | Save currently opened stage to file. | | `save_as` (flatten, callback[, ...]) | Bring up a file picker to choose a file to save current stage to. | | `save_layers` (new_root_path, dirty_layers, ...) | Save current layers. | | `save_stage` (path[, callback, flatten, ...]) | Save current stage to the given path, if the path exists bring up the filepicker to choose a potential new path. | | `stop_timeline` () | Stop the timeline. | ``` ```markdown __init__ (self: omni.ext._extensions.IExt) ### omni.kit.window.file.FileWindowExtension Methods #### __init__ - **Description**: Initializes the extension. #### add_reference - **Description**: Prompt for the file to add reference or payload to. - **Keyword Arguments**: - **is_payload** (bool) – True to add payload instead of reference. #### close - **Description**: Check if current stage is dirty. If it’s dirty, it will ask if to save the file, then close stage. - **Parameters**: - **on_closed** (Callable) – function to call after closing, Function Signature: on_closed() -> None - **Keyword Arguments**: - **fast_shutdown** (bool) – clear pending edits immediately to shutdown faster. #### create_stage - **Description**: Create a stage with edit layer from paths. - **Parameters**: - **edit_layer_path** (str) – path to create the edit layer. - **file_path** (str) – path to create the stage. - **Keyword Arguments**: - **callback** – (Callable): callback to call after creating stage. Function Signature: callback() -> None Create a new USD stage. If currently opened stage is dirty, a prompt will show to let you save it. **Keyword Arguments** * **template** (`Optional` `[str]`) – the template to use. Cleanup the extension. Initialize the extension. :param ext_id: Extension identifier. :type ext_id: str Bring up a file picker to choose a USD file to open. If currently opened stage is dirty, a prompt will show to let you save it. **Keyword Arguments** * **open_loadset** (`omni.usd.UsdContextInitialLoadSet`) – initial load set enum, LOAD_ALL or LOAD_NONE. Open stage. If the current stage is dirty, a prompt will show to let you save it. **Parameters** * **path** (`str`) – the path to the stage file to open. **Keyword Arguments** * **open_loadset** (`omni.usd.UsdContextInitialLoadSet`) – initial load set enum, LOAD_ALL or LOAD_NONE. * **open_options** (`OpenOptionsDelegate`) – if set, use the open_loadset setting from options. ### open_with_new_edit_layer Open stage and create a new edit layer. #### Parameters - **path** (str) – path to open the stage. #### Keyword Arguments - **open_loadset** (omni.usd.UsdContextInitialLoadSet) – initial load set enum, LOAD_ALL or LOAD_NONE. - **callback** – (Callable): callback to call after creating stage. Function Signature: callback() -> None ### post_notification Post a notification message. #### Parameters - **message** (str) – message text. - **info** (bool) – If True, post the message as info or otherwise warning. - **duration** (int) – Duration of notification, in seconds. ### prompt_if_unsaved_stage Check if current stage is dirty. If it’s dirty, ask to save the file, then execute callback. Otherwise runs callback directly. #### Parameters - **callback** (Callable) – function to call upon saving. Function Signature: callback() -> None ### register_open_stage_addon ### omni.kit.window.file.FileWindowExtension.register_open_stage_addon Register callback to call when opening a stage. #### Parameters - **callback** (`Callable`) – function to call. Function Signature: `callback() -> None` #### Returns - The callback subscription. #### Return type - `_CallbackRegistrySubscription` ### omni.kit.window.file.FileWindowExtension.register_open_stage_complete Register callback to call when finish opening a stage. #### Parameters - **callback** (`Callable`) – function to call. Function Signature: `callback() -> None` #### Returns - The callback subscription. #### Return type - `_CallbackRegistrySubscription` ### omni.kit.window.file.FileWindowExtension.reopen Reopen currently opened stage. If the stage is dirty, a prompt will show to let you save it. ### omni.kit.window.file.FileWindowExtension.save Save currently opened stage to file. Will call Save As for a newly created stage. ### Keyword Arguments - **callback** (`Callable`) – function to call after saving. Function Signature: `callback(result: bool, url: str) -> None` - **allow_skip_sublayers** (`bool`) – True to skip sublayers. - **dialog_options** (`DialogOptions`) – options for opening the dialog. ### save_as ```python save_as(flatten: bool, callback: Callable[[bool, str], None], allow_skip_sublayers: bool = False) ``` Bring up a file picker to choose a file to save current stage to. #### Parameters - **flatten** (`bool`) – Whether to flatten the stage or not. #### Keyword Arguments - **callback** (`Callable`) – function to call after saving. Function Signature: `callback(result: bool, url: str) -> None` - **allow_skip_sublayers** (`bool`) – True to skip sublayers. ### save_layers ```python save_layers(new_root_path: str, dirty_layers: List[str], on_save_done: Callable[[bool, str], None]) ``` ## save_layers Save current layers. ### Parameters - **new_root_path** (str) – path to set the root layer. - **dirty_layers** (List[str]) – layer identifiers to save. - **on_save_done** (Callable) – function to call after saving. Function Signature: `on_save_done(result: bool, url: str) -> None` ### Keyword Arguments - **create_checkpoint** (bool) – true to create checkpoints. - **checkpoint_comments** (str) – comment on the created checkpoint. ## save_stage ### Parameters - **path** (str) - **callback** (Optional[Callable[[bool, str], None]] = None) - **flatten** (bool = False) - **save_options** (Optional[SaveOptionsDelegate] = None) - **allow_skip_sublayers** (bool = True) ## omni.kit.window.file.FileWindowExtension.save_stage Save current stage to the given path, if the path exists bring up the filepicker to choose a potential new path. ### Parameters - **path** (str) – path to save the file. ### Keyword Arguments - **callback** (Callable) – function to call after saving. Function Signature: `callback(result: bool, url: str) -> None` - **flatten** (bool) – whether to flatten the stage or not. - **save_options** (SaveOptionsDelegate) – if set, load save settings from it. - **allow_skip_sublayers** (bool) – True to skip sublayers. ## omni.kit.window.file.FileWindowExtension.stop_timeline Stop the timeline.
omni.kit.window.file.Functions.md
# omni.kit.window.file Functions ## Functions Summary: | Function | Description | |----------|-------------| | `add_reference` | Prompt for the file to add reference or payload to. | | `close` | Check if current stage is dirty. If it’s dirty, it will ask if to save the file, then close stage. | | `get_instance` | Get the extension instance. | | `new` | Create a new USD stage. If currently opened stage is dirty, a prompt will show to let you save it. | | `open` | Bring up a file picker to choose a USD file to open. If currently opened stage is dirty, a prompt will show to let you save it. | | `open_stage` | Open stage. If the current stage is dirty, a prompt will show to let you save it. | | `open_with_new_edit_layer` | Open stage and create a new edit layer. | | `prompt_if_unsaved_stage` | Check if current stage is dirty. If it’s dirty, ask to save the file, then execute callback. Otherwise runs callback directly. | | `register_open_stage_addon` | Register callback to call when opening a stage. | | `register_open_stage_complete` | Register callback to call when finish opening a stage. | | `reopen` | | | 操作 | 描述 | | --- | --- | | reopen | Reopen currently opened stage. If the stage is dirty, a prompt will show to let you save it. | | save | Save currently opened stage to file. Will call Save As for a newly created stage. | | save_as | Bring up a file picker to choose a file to save current stage to. | | save_layers | Save current layers. |
omni.kit.window.file.get_instance.md
# get_instance ## get_instance ### omni.kit.window.file.get_instance Get the extension instance.
omni.kit.window.file.md
# omni.kit.window.file ## Classes Summary: - **DialogOptions** - Enum for dialog options. - **FileWindowExtension** - File window extension interface. - **Prompt** - A pop up window in context manager style to perform operations when inside the context. - **ReadOnlyOptionsWindow** - Prompt window class to show when opening a read only file. - **StageSaveDialog** - Dialog class for saving stage. ## Functions Summary: - **add_reference** - Prompt for the file to add reference or payload to. - **close** - Check if current stage is dirty. If it’s dirty, it will ask if to save the file, then close stage. - **get_instance** - Get the extension instance. - **new** - Create a new USD stage. If currently opened stage is dirty, a prompt will show to let you save it. - **open** - Bring up a file picker to choose a USD file to open. If currently opened stage is dirty, a prompt will show to let you save it. - **open_stage** - (Function description not provided in the HTML) | | | |------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | open_stage | Open stage. If the current stage is dirty, a prompt will show to let you save it. | | | | | open_with_new_edit_layer | Open stage and create a new edit layer. | | | | | prompt_if_unsaved_stage | Check if current stage is dirty. If it’s dirty, ask to save the file, then execute callback. Otherwise runs callback directly. | | | | | register_open_stage_addon | Register callback to call when opening a stage. | | | | | register_open_stage_complete | Register callback to call when finish opening a stage. | | | | | reopen | Reopen currently opened stage. If the stage is dirty, a prompt will show to let you save it. | | | | | save | Save currently opened stage to file. Will call Save As for a newly created stage. | | | | | save_as | Bring up a file picker to choose a file to save current stage to. | | | | | save_layers | Save current layers. |
omni.kit.window.file.new.md
# new ## new Create a new USD stage. If currently opened stage is dirty, a prompt will show to let you save it. ### Keyword Arguments - **template** (Optional [str]) – the template to use.
omni.kit.window.file.open.md
# open ## open Bring up a file picker to choose a USD file to open. If currently opened stage is dirty, a prompt will show to let you save it. ### Keyword Arguments - **open_loadset** (omni.usd.UsdContextInitialLoadSet) – initial load set enum, LOAD_ALL or LOAD_NONE.
omni.kit.window.file.open_stage.md
# open_stage ## open_stage ```python omni.kit.window.file.open_stage(path: str, open_loadset=<UsdContextInitialLoadSet.LOAD_ALL: 0>) ``` Open stage. If the current stage is dirty, a prompt will show to let you save it. ### Parameters - **path** (str) – path to open the stage. ### Keyword Arguments - **open_loadset** (omni.usd.UsdContextInitialLoadSet) – initial load set enum, LOAD_ALL or LOAD_NONE.
omni.kit.window.file.open_with_new_edit_layer.md
# open_with_new_edit_layer ## open_with_new_edit_layer ```python omni.kit.window.file.open_with_new_edit_layer(path: str, open_loadset=<UsdContextInitialLoadSet.LOAD_ALL: 0>, callback: Optional[Callable[[], None]] = None) ``` Open stage and create a new edit layer. **Parameters** - **path** (str) – path to open the stage. **Keyword Arguments** - **open_loadset** (UsdContextInitialLoadSet) – initial load set enum, LOAD_ALL or LOAD_NONE. - **callback** – (Callable): callback to call after creating stage. Function Signature: `callback() -> None`
omni.kit.window.file.Prompt.md
# Prompt ## Prompt Class ```python class omni.kit.window.file.Prompt(title: str, text: str, button_text: List[str], button_fn: List[Callable[[], None]], modal: bool = False, callback_addons: List[Callable[[], None]] = []) ``` This class represents a prompt window in the file module of Omniverse Kit. ``` Bases: ```python object ``` A pop up window in context manager style to perform operations when inside the context. Parameters: - **title** (str) – window title. - **text** (str) – description of the operation to perform when in context. - **button_text** (List[str]) – text of buttons to create. - **button_fn** (List[Callable]) – functions to call after clicking buttons. Keyword Arguments: - **modal** (bool) – True to disable hang detection when in context. - **callback_addons** (List[Callable]) – callbacks to perform after initializing the window. - **callback_destroy** (List[Callable]) – callbacks to perform after destroying the window. - **decode_text** (bool) – unwrap quotes if set. Methods: - `__init__(title, text, button_text, button_fn)` - `destroy()` - Destructor. - `hide()` | Action | Description | |--------|-------------| | Hide the window. | Hide the window. | | is_visible() | Return True if window is visible. | | set_text(text) | Set the operation description. | | show() | Show the window. | __init__(title: str, text: str, button_text: List[str], button_fn: List[Callable[[], None]], modal: bool = False, callback_addons: List[Callable[[], None]] = [], callback_destroy: List[Callable[[], None]] = []) ### omni.kit.window.file.Prompt Methods #### `__init__(self, default_files=None, decode_text=True)` - **default_files**: Default value is `None`. - **decode_text**: Default value is `True`. #### `destroy()` - Destructor. #### `hide()` - Hide the window. #### `is_visible()` - Returns: - Return `True` if window is visible. #### `set_text(text)` - Set the operation description. #### `show()` - Show the window.
omni.kit.window.file.prompt_if_unsaved_stage.md
# prompt_if_unsaved_stage ## prompt_if_unsaved_stage ``` Check if current stage is dirty. If it’s dirty, ask to save the file, then execute callback. Otherwise runs callback directly. ### Parameters - **job** (Callable) – function to call upon saving. Function Signature: job() -> None
omni.kit.window.file.ReadOnlyOptionsWindow.md
# ReadOnlyOptionsWindow ## ReadOnlyOptionsWindow ```python class omni.kit.window.file.ReadOnlyOptionsWindow(open_with_new_edit_fn: Callable[[], None], open_original_fn: Callable[[], None], modal: bool = False) ``` **Bases:** `object` **Description:** Prompt window class to show when opening a read only file. **Parameters:** - **open_with_new_edit_fn** (Callable) – function to call when opening with a new edit layer. - **open_original_fn** (Callable) – function to call when opening original file. **Keyword Arguments:** - **modal** (bool) – True if window is modal. ``` ## Methods | Method Name | Description | |-------------|-------------| | `__init__(open_with_new_edit_fn, open_original_fn)` | | | `destroy()` | Destructor. | | `hide()` | Hide the window. | | `is_visible()` | Returns: Return True if window is visible. | | `show()` | Show the window. | ### __init__(open_with_new_edit_fn: Callable[[], None], open_original_fn: Callable[[], None], modal: bool = False) ### destroy() Destructor. ### hide() Hide the window. ### is_visible() Returns: Return True if window is visible. ### show() Show the window. show() Show the window.
omni.kit.window.file.register_open_stage_addon.md
# register_open_stage_addon ## register_open_stage_addon ```python omni.kit.window.file.register_open_stage_addon(callback) ``` Register callback to call when opening a stage. ### Parameters - **callback** (Callable) – function to call. Function Signature: `callback() -> None` ### Returns - The callback subscription. ### Return type - `_CallbackRegistrySubscription`
omni.kit.window.file.register_open_stage_complete.md
# register_open_stage_complete ## register_open_stage_complete ```python omni.kit.window.file.register_open_stage_complete(callback) ``` Register callback to call when finish opening a stage. ### Parameters - **callback** (`Callable`) – function to call. Function Signature: `callback() -> None` ### Returns - The callback subscription. ### Return type - `_CallbackRegistrySubscription`
omni.kit.window.file.reopen.md
# reopen ## reopen Reopen currently opened stage. If the stage is dirty, a prompt will show to let you save it.
omni.kit.window.file.save.md
# save ## save ```python omni.kit.window.file.save(on_save_done: Optional[Callable[[bool, str], None]] = None, exit: bool = False, dialog_options: DialogOptions = DialogOptions.NONE) ``` Save currently opened stage to file. Will call Save As for a newly created stage. ### Keyword Arguments - **on_save_done** (`Callable`): function to call after saving. Function Signature: `on_save_done(result: bool, url: str) -> None` - **exit** (`bool`): Unused parameter. - **dialog_options** ([`DialogOptions`](omni.kit.window.file.DialogOptions.html#omni.kit.window.file.DialogOptions)): options for opening the dialog. --- title: 示例文档 --- # 示例文档标题 这是一段示例文本,用于展示如何将HTML格式转换为Markdown格式。 ## 子标题 这里是子标题下的内容。 ### 更小的标题 这里是更小的标题下的内容。
omni.kit.window.file.save_as.md
# save_as ## save_as ```python omni.kit.window.file.save_as(flatten, on_save_done: Optional[Callable[[bool, str], None]] = None) ``` Bring up a file picker to choose a file to save current stage to. ### Parameters - **flatten** (bool) – Whether to flatten the stage or not. ### Keyword Arguments - **on_save_done** (Callable) – function to call after saving. Function Signature: on_save_done(result: bool, url: str) -> None
omni.kit.window.file.save_layers.md
# save_layers ## save_layers Save current layers. ### Parameters - **new_root_path** (`str`) – path to set the root layer. - **dirty_layers** (`List[str]`) – layer identifiers to save. - **on_save_done** (`Callable`) – function to call after saving. Function Signature: `on_save_done(result: bool, url: str) -> None` ### Keyword Arguments - **create_checkpoint** (`bool`) – true to create checkpoints. - **checkpoint_comments** (`str`) – comment on the created checkpoint.
omni.kit.window.file.StageSaveDialog.md
# StageSaveDialog ## StageSaveDialog ## omni.kit.window.file.StageSaveDialog ### Description Dialog class for saving stage. ### Keyword Arguments - **on_save_fn** (Callable) – function to call when clicking ‘Save Selected’ button. - **on_dont_save_fn** (Callable) – function to call when clicking ‘Don’t Save’ button. - **on_cancel_fn** (Callable) – function to call when clicking cancel button. - **enable_dont_save** (bool) – Disable ‘Don’t Save’ button. ### Methods - **__init__(on_save_fn, on_dont_save_fn, on_cancel_fn, enable_dont_save)** - Initialize the dialog. - **destroy()** - Destructor. - **is_visible()** - Returns: True if dialog is visible. - **show(layer_identifiers)** - Show the dialog. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.file.StageSaveDialog.__init__"> <span class="sig-name descname"> <span class="pre"> __init__ </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> parent </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> Optional </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> QWidget </span> <span class="p"> <span class="pre"> ] </span> </span> </span> <span class="w"> </span> <span class="o"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="default_value"> <span class="pre"> None </span> </span> </em> , <em class="sig-param"> <span class="n"> <span class="pre"> on_cancel_fn </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> Optional </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> Callable </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="p"> <span class="pre"> ] </span> </span> <span class="p"> <span class="pre"> ] </span> </span> </span> <span class="w"> </span> <span class="o"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="default_value"> <span class="pre"> None </span> </span> </em> , <em class="sig-param"> <span class="n"> <span class="pre"> enable_dont_save </span> </span> <span class="o"> <span class="pre"> = </span> </span> <span class="default_value"> <span class="pre"> False </span> </span> </em> <span class="sig-paren"> ) </span> </dt> <dd> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.file.StageSaveDialog.destroy"> <span class="sig-name descname"> <span class="pre"> destroy </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> </dt> <dd> <p> Destructor. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.file.StageSaveDialog.is_visible"> <span class="sig-name descname"> <span class="pre"> is_visible </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> </dt> <dd> <dl class="field-list simple"> <dt class="field-odd"> Returns </dt> <dd class="field-odd"> <p> Return True if dialog is visible. </p> </dd> </dl> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.file.StageSaveDialog.show"> <span class="sig-name descname"> <span class="pre"> show </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> layer_identifiers </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> List </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> str </span> <span class="p"> <span class="pre"> ] </span> </span> </span> <span class="w"> </span> <span class="o"> <span class="pre"> = </span> </span> <span class="w"> </span> <span class="default_value"> <span class="pre"> [] </span> </span> </em> <span class="sig-paren"> ) </span> </dt> <dd> <p> Show the dialog. :keyword layer_identifiers: list of layer identifier URLs. :kwtype layer_identifiers: List[str] </p> </dd> </dl> </dd> </dl>
omni.kit.window.filepicker.BaseContextMenu.md
# BaseContextMenu ## BaseContextMenu ```python class omni.kit.window.filepicker.BaseContextMenu(title: Optional[str] = None, **kwargs) ``` Bases: `object` Base class popup menu for the hovered FileBrowserItem. Provides API for users to add menu items. ### Methods - **`__init__(title)`** - Initialize the BaseContextMenu. - **`add_menu_item(name, glyph, onclick_fn, show_fn)`** - Adds menu item, with corresponding callbacks, to this context menu. - **`delete_menu_item(name)`** - Deletes the menu item, with the given name, from this context menu. - **`destroy()`** - Destroys the context menu. ### Methods - **destroy**() - Destructor. - **hide**() - Hides the popup menu if it is shown. - **show**(item[, selected]) - Creates the popup menu from definition for immediate display. ### Attributes - **context** - Provides data to the callback. - **menu** - `omni.ui.Menu` The menu widget ### Initialization ```python __init__(title: Optional[str] = None, **kwargs) ``` - Initialize the BaseContextMenu. - **Keyword Arguments** - **title** (Optional[str]) – The title of the context menu default `None`. ### Method ```python add_menu_item(name: str, glyph: str, onclick_fn: Callable, show_fn: Callable, index: int = -1, separator_name: str) ``` - Add a menu item to the context menu. - **Parameters** - **name** (str) – The name of the menu item. - **glyph** (str) – The glyph associated with the menu item. - **onclick_fn** (Callable) – The function to call when the menu item is clicked. - **show_fn** (Callable) – The function to call to show the menu item. - **index** (int) – The index at which to insert the menu item, default is -1 (append). - **separator_name** (str) – The name of the separator to insert before the menu item. ``` ### add_menu_item Adds menu item, with corresponding callbacks, to this context menu. #### Parameters - **name** (str) – Name of the menu item (e.g. ‘Open’), this name must be unique across the context menu. - **glyph** (str) – Associated glyph to display for this menu item. - **onclick_fn** (Callable) – This callback function is executed when the menu item is clicked. Function signature: void fn(context: Dict) - **show_fn** (Callable) – Returns True to display this menu item. Function signature: bool fn(context: Dict). For example, test filename extension to decide whether to display a ‘Play Sound’ action. - **index** (int) – The position that this menu item will be inserted to. - **separator_name** (str) – The separator name of the separator menu item. Default to ‘_placeholder_’. When the index is not explicitly set, or if the index is out of range, this will be used to locate where to add the menu item; if specified, the index passed in will be counted from the separator with the provided name. This is for OM-86768 as part of the effort to match Navigator and Kit UX for Filepicker/Content Browser for context menus. #### Returns Name of menu item if successful, None otherwise. #### Return type str ### delete_menu_item Deletes the menu item, with the given name, from this context menu. #### Parameters - **name** (str) – Name of the menu item (e.g. ‘Open’). ### destroy Destructor. ### hide Hides the popup menu if it is shown. ### show Shows the popup menu if it is shown. #### Parameters - **item** (FileBrowserItem) - **selected** (List[FileBrowserItem]) = None ## omni.kit.window.filepicker.BaseContextMenu.show Creates the popup menu from definition for immediate display. Receives as input, information about the item. These values are made available to the callback via the ‘context’ dictionary. ### Parameters - **item** (FileBrowseritem) – Item for which to create menu. - **selected** ([FileBrowserItem]) – List of currently selected items. Default []. ## omni.kit.window.filepicker.BaseContextMenu.context Provides data to the callback. Available keys are {‘item’, ‘selected’} ### Type dict ## omni.kit.window.filepicker.BaseContextMenu.menu `omni.ui.Menu` The menu widget ### Returns - Type: obj
omni.kit.window.filepicker.BookmarkContextMenu.md
# BookmarkContextMenu ## Overview Creates popup menu for BookmarkItems. ### Methods | Method | Description | |--------|-------------| | `__init__(**kwargs)` | Initialize the BaseContextMenu. | ### Attributes No attributes listed. ### Detailed Method Description **`__init__(**kwargs)`** - **Description**: Initialize the BaseContextMenu. - **Keyword Arguments**: - `title` (Optional [str]): The title of the context menu default `None`.
omni.kit.window.filepicker.Classes.md
# omni.kit.window.filepicker Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | BaseContextMenu | Base class popup menu for the hovered FileBrowserItem. Provides API for users to add menu items. | | BookmarkContextMenu | Creates popup menu for BookmarkItems. | | CollectionContextMenu | Creates popup menu for the hovered FileBrowserItem that are collection nodes. | | CollectionData | CollectionData holds data and callbacks used to construct a registered collection type with the content browser. | | ContextMenu | Creates popup menu for the hovered FileBrowserItem. In addition to the set of default actions below, | | DetailFrameController | | | DetailView | Detail view that contains all detail frames | | FilePickerAPI | This class defines the API methods for :obj:`FilePickerWidget`. | | FilePickerDialog | A popup window for browsing the filesystem and taking action on a selected file. | | FilePickerExtension | The filepicker extension is not necessarily integral to using the widget. However, it is useful for handling | | FilePickerModel | | | Class Name | Description | |------------|-------------| | FilePickerModel | The model class for :obj:`FilePickerWidget`. | | FilePickerView | An embeddable UI component for browsing the filesystem. This widget is more full-functioned | | FilePickerWidget | An embeddable UI widget for browsing the filesystem and taking action on a selected file. | | SearchDelegate | | | SearchResultsItem | Base class for the Filebrowser view Item. | | SearchResultsModel | Base class for the Filebrowser view Model. | | TimestampWidget | | | ToolBar | | | UdimContextMenu | Creates popup menu for the hovered FileBrowserItem that are Udim nodes. |
omni.kit.window.filepicker.CollectionContextMenu.md
# CollectionContextMenu ## CollectionContextMenu ```python class omni.kit.window.filepicker.CollectionContextMenu(**kwargs) ``` Bases: `BaseContextMenu` Creates popup menu for the hovered FileBrowserItem that are collection nodes. ### Methods | Method | Description | |--------|-------------| | `__init__(**kwargs)` | Initialize the BaseContextMenu. | ### Attributes | Attribute | Description | |-----------|-------------| ```python def __init__(**kwargs): Initialize the BaseContextMenu. ``` Keyword Arguments: - `title` (Optional[str]) – The title of the context menu default `None`. ```
omni.kit.window.filepicker.CollectionData.md
# CollectionData ## CollectionData Bases: `object` CollectionData holds data and callbacks used to construct a registered collection type with the content browser. - **identifier**: Key identifier for the collection type - **title**: Title to display for the collection type in the content browser tree view - **path_to_icon**: Path to the (svg) icon used in the content browser tree view for the registered collection type - **model**: Data model inheriting FileBrowserModel for the collection - **populate_fn**: Callback function that populates the model with pre-existing content items ### Methods | Method | Description | |--------|-------------| ### Attributes - `identifier` - `title` - `path_to_icon` - `model` - `populate_fn` ### __init__ Method ```python def __init__(identifier: str, title: str, path_to_icon: str, model: FileBrowserModel, populate_fn: Callable[[], None]) -> None: pass ``` ```
omni.kit.window.filepicker.ContextMenu.md
# ContextMenu ## Overview Creates popup menu for the hovered FileBrowserItem. In addition to the set of default actions below, users can add more via the add_menu_item API. ### Methods - `__init__(**kwargs)` - Creates the ContextMenu for the file picker, including all common menu items ### Attributes - None listed ## Detailed Description ### `__init__(**kwargs)` - Creates the ContextMenu for the file picker, including all common menu items
omni.kit.window.filepicker.DetailFrameController.md
# DetailFrameController ## DetailFrameController ### omni.kit.window.filepicker.DetailFrameController **Parameters:** - glyph: Optional[Callable[[], None]] = None - build_fn: Optional[Callable[[], None]] = None - filename_changed_fn: Optional[Callable[[str], None]] = None - destroy_fn: Optional[Callable[[], None]] = None - **kwargs **Bases:** - object **Methods:** - **__init__(glyph, build_fn, filename_changed_fn, destroy_fn, **kwargs)** - Initialize the Detail Frame. - **build_header(collapsed, title)** - Builds the header. - **build_ui(frame)** - Builds the UI. - **destroy()** - Destructor - **on_filename_changed(filename)** - Called when the filename has changed. It will rebuild the detail frame. - **on_selection_changed(selected)** - Called when the selection changes. (glyph: Optional[str] = None, build_fn: Optional[Callable[[], None]] = None, selection_changed_fn: Optional[Callable[[List[str]], None]] = None, filename_changed_fn: Optional[Callable[[str], None]] = None, destroy_fn: Optional[Callable[[], None]] = None) ### __init__(**kwargs) Initialize the Detail Frame. #### Keyword Arguments - **glyph** (Optional [str]) – The name of the glyph to use for the widget. - **build_fn** (Callable) – A function that will be called when build the detail frame. Function signature: void build_fn() - **selection_changed_fn** (Callable) – A function that will be called when the selection changes. Function signature: void selection_changed_fn(list[str]) - **filename_changed_fn** (Callable) – A function that will be called when the filename of current item changes. Function signature: void filename_changed_fn(str) - **destroy_fn** (Callable) – A function that will be called when the widget is destroyed. Function signature: void destroy_fn() ### build_header(collapsed: bool, title: str) Builds the header. It is used to show the header of the DetailFrame. - :param collapsed: True if the header is collapsed. - :type collapsed: bool - :param title: title of the header to be shown. - :type title: str ### build_ui(frame: Frame) Builds the UI. - :param frame: The frame that will be used to build the UI. - :type frame: ui.Frame ### destroy() Destructor ### on_filename_changed(filename: str) Called when the filename has changed. It will rebuild the detail frame. - Parameters - **filename** (str) – The filename that has changed. ### on_selection_changed(selected: List[str]) Called when the selection has changed. - Parameters - **selected** (List[str]) – The list of selected items. ## Omni.Kit.Window.FilePicker.DetailFrameController.on_selection_changed ### Description Called when the selection changes. It will rebuild the detail frame. ### Keywords Args - selected(List[str]): List of selected items’s path.
omni.kit.window.filepicker.DetailView.md
# DetailView ## DetailView ```python class omni.kit.window.filepicker.DetailView(**kwargs) ``` Bases: `object` Detail view that contains all detail frames ### Methods | Method | Description | |--------|-------------| | `__init__(**kwargs)` | | | `add_detail_frame(name, glyph, build_fn[, ...])` | Adds sub-frame to the detail view, and populates it with a custom built widget. | | `add_detail_frame_from_controller(name[, ...])` | Adds sub-frame to the detail view, and populates it with a custom built widget. | | `delete_detail_frame(name)` | Deletes the specified detail frame. | | `destroy()` | Destructor | | `get_detail_frame()` | | ``` | Method | Description | | ------ | ----------- | | `get_detail_frame(name)` | Get the detail frame by given name. | | `on_filename_changed([filename])` | When the user edits the filename, invokes the callbacks for the detail frames. | | `on_selection_changed([selected])` | When the user changes their filebrowser selection(s), invokes the callbacks for the detail frames. | ### `__init__(**kwargs)` ### `add_detail_frame(name: str, glyph: str, build_fn: Callable[[], Widget], selection_changed_fn: Optional[Callable[[List[str]], None]] = None, filename_changed_fn: Optional[Callable[[str], None]] = None)` ### add_detail_frame ```python add_detail_frame( name: str, glyph: str, build_fn: Callable[[Widget], None] = None, selection_changed_fn: Optional[Callable[[Widget], None]] = None, filename_changed_fn: Optional[Callable[[Widget], None]] = None, destroy_fn: Optional[Callable[[Widget], None]] = None ) ``` Adds sub-frame to the detail view, and populates it with a custom built widget. **Parameters** - **name** (str) – Name of the widget sub-section, this name must be unique over all detail sub-sections. - **glyph** (str) – Associated glyph to display for this sub-section - **build_fn** (Callable) – This callback function builds the widget. **Keyword Arguments** - **selection_changed_fn** (Callable) – This callback is invoked to handle selection changes. - **filename_changed_fn** (Callable) – This callback is invoked when filename is changed. - **destroy_fn** (Callable) – Cleanup function called when destroyed. ### add_detail_frame_from_controller ```python add_detail_frame_from_controller( name: str, detail_frame: Optional[DetailFrameController] = None ) ``` Adds sub-frame to the detail view, and populates it with a custom built widget. **Parameters** - **name** (str) – Name of the widget sub-section, this name must be unique over all detail sub-sections. - **controller** (DetailFrameController) – Controller object that encapsulates all aspects of creating, updating, and deleting a detail frame widget. ### delete_detail_frame Deletes the specified detail frame. #### Parameters - **name** (str) – Name of the detail frame. ### destroy Destructor ### get_detail_frame Get the detail frame by given name. This method is thread safe. Use with caution #### Parameters - **name** – Name of the detail frame #### Returns - obj:’DetailFrameController’ with given name or None if not found ### on_filename_changed When the user edits the filename, invokes the callbacks for the detail frames. #### Parameters - **filename** (str) – Current filename. ### on_selection_changed When the user changes their filebrowser selection(s), invokes the callbacks for the detail frames. #### Parameters - **selected** (List[FileBrowserItem]) – List of new selections.
omni.kit.window.filepicker.FilePickerAPI.md
# FilePickerAPI ## FilePickerAPI ```python class omni.kit.window.filepicker.FilePickerAPI(model: Optional[FilePickerModel] = None, view: Optional[FilePickerView] = None) ``` Bases: `object` This class defines the API methods for `FilePickerWidget`. ### Methods | Method | Description | |--------|-------------| | `__init__(model, view)` | Initialize the FilePickerAPI. | - `add_collection(collection_data)` - Add custom collection to current content view. - `add_connections(connections)` - Adds specified server connections to the tree browser. - `add_context_menu(name, glyph, click_fn, show_fn)` - Adds menu item, with corresponding callbacks, to the context menu. - `add_detail_frame(name, glyph, build_fn[, ...])` - Adds sub-frame to the detail view, and populates it with a custom built widget. - `add_detail_frame_from_controller(name, ...)` - Adds sub-frame to the detail view, and populates it with a custom built widget. - `add_listview_menu(name, glyph, click_fn, show_fn)` - Adds menu item, with corresponding callbacks, to the list view menu. - `add_show_only_collection(collection_id)` - Add a filter to show collections. - `connect_server(url[, callback])` - Connects the server for given url. - `delete_context_menu(name)` - Deletes the menu item, with the given name, from the context menu. - `delete_detail_frame(name)` - Deletes the specified detail subsection. - `delete_listview_menu(name)` - Deletes the menu item, with the given name, from the list view menu. - `destroy()` - Destructor. - `find_subdirs_async(url, callback)` - Asynchronously executes callback on list of subdirectories at given url. - `find_subdirs_with_callback(url, callback)` - Executes callback on list of subdirectories at given url. - `get_current_directory()` - Returns the current directory from the browser bar. - `get_current_selections([pane])` - Returns current selected as list of system path names. - `get_filename()` - Currently selected filename. - `hide_loading_pane()` - Hide the loading icon if it exists. - `navigate_to(url[, callback])` - Navigates to the given url, expanding all parent directories in the path. - `navigate_to_async(url[, callback])` - Asynchronously navigates to the given url, expanding all parent directories in the path. - `refresh_current_directory()` - Refreshes the current directory set in the browser bar. - `remove_collection(collection_id)` - Remove custom collection from current content view. - `remove_show_only_collection(collection_id)` - Remove the collection filter. - `select_items_async(url[, filenames])` - Asynchronously select one or more items in the content view. - `set_current_directory(path)` - Procedurally sets the current directory. - `set_filename(filename)` - Sets the filename in the file bar, at the bottom of the dialog. - `set_search_delegate(delegate)` - Sets a custom search delegate for the toolbar. - `show_model(model)` - (Description not provided in HTML) | Displays the given model in the list view, overriding the default model. | | --- | | Subscribe to omni.client bookmark changes. | | Adds/deletes the given bookmark with the specified path. | ### __init__ ```python __init__(model: Optional[FilePickerModel] = None, view: Optional[FilePickerView] = None) ``` Initialize the FilePickerAPI. **Parameters** - **model** (FilePickerModel) – The model background, default None. - **view** (FilePickerView) – The content view object. Default None. ### add_collection ```python add_collection(collection_data: CollectionData) ``` Add custom collection to current content view. Samples of collection: “My Computer”, “Omniverse Bookmark”, … **Parameters** - **collection_data** (CollectionData) – Data to add. ### add_connections ```python add_connections(connections: dict) ``` Adds specified server connections to the tree browser. To facilitate quick startup time, doesn’t check whether the connection is actually valid. **Parameters** - **connections** (dict) – Connections to add. ``` **connections** (**dict**) – A dictionary of name, path pairs. For example: {"C:": "C:", "ov-content": "omniverse://ov-content"}. Paths to Omniverse servers should be prefixed with “omniverse://”. ### add_context_menu Adds menu item, with corresponding callbacks, to the context menu. #### Parameters - **name** (**str**) – Name of the menu item (e.g. ‘Open’), this name must be unique across the context menu. - **glyph** (**str**) – Associated glyph to display for this menu item. - **click_fn** (**Callable**) – This callback function is executed when the menu item is clicked. Function signature: void fn(name: str, path: str), where name is menu name and path is absolute path to clicked item. - **show_fn** (**Callable**) – Returns True to display this menu item. Function signature: bool fn(path: str). For example, test filename extension to decide whether to display a ‘Play Sound’ action. - **index** (**int**) – The position that this menu item will be inserted to. - **separator_name** (**str**) – The separator name of the separator menu item. Default to ‘_placeholder_’. When the index is not explicitly set, or if the index is out of range, this will be used to locate where to add the menu item; if specified, the index passed in will be counted from the separator with the provided name. This is for OM-86768 as part of the effort to match Navigator and Kit UX for Filepicker/Content Browser for context menus. #### Returns Name of menu item if successful, None otherwise. #### Return type str ### add_detail_frame (Markdown for this section is incomplete as the HTML snippet provided is cut off.) ### Parameters - **name** (str) – Name of the widget sub-section, this name must be unique over all detail sub-sections. - **glyph** (str) – Associated glyph to display for this subj-section - **build_fn** (Callable) – This callback function builds the widget. ### Keyword Arguments - **selection_changed_fn** (Callable) – This callback is invoked to handle selection changes. - **filename_changed_fn** (Callable) – This callback is invoked to handle filename changes. - **destroy_fn** (Callable) – This callback is invoked to handle destruction of the widget. Adds sub-frame to the detail view, and populates it with a custom built widget. ### FilePickerAPI Methods #### add_detail_frame_from_controller ```python add_detail_frame_from_controller(name: str, controller: DetailFrameController) ``` Adds sub-frame to the detail view, and populates it with a custom built widget. **Parameters:** - **name** (str) – Name of the widget sub-section, this name must be unique over all detail sub-sections. - **controller** (DetailFrameController) – Controller object that encapsulates all aspects of creating, updating, and deleting a detail frame widget. #### add_listview_menu ```python add_listview_menu(name: str, glyph: str, click_fn: Callable, show_fn: Callable, index: int = -1) -> str ``` Adds menu item, with corresponding callbacks, to the list view menu. **Parameters:** - **name** (str) – Name of the menu item (e.g. ‘Open’), this name must be unique across the list view menu. - **glyph** (str) – Associated glyph to display for this menu item. - **click_fn** (Callable) – This callback function is executed when the menu item is clicked. Function signature: void fn(name: str, path: str), where name is menu name and path is absolute path to clicked item. - **show_fn** (Callable) – Returns True to display this menu item. Function signature: bool fn(path: str). For example, test filename extension to decide whether to display a ‘Play Sound’ action. ### add_menu Adds a new menu item to the specified position. #### Parameters - **index** (int) – The position that this menu item will be inserted to. #### Returns - Name of menu item if successful, None otherwise. #### Return type - str ### add_show_only_collection Add a filter to show collections. If this collection filter is provided, only those that match the filter will be shown, other collections will be hidden. Otherwise all collections are shown. #### Parameters - **collection_id** (str) – the filter. ### connect_server Connects the server for given url. #### Parameters - **url** (str) – Given url. - **callback** (Callable) – On successfully connecting the server, executes this callback. Function signature: void callback(name: str, server_url: str) ### delete_context_menu Deletes the menu item, with the given name, from the context menu. #### Parameters - **name** (str) – Name of the menu item (e.g. ‘Open’). ### delete_detail_frame Deletes the specified detail subsection. #### Parameters - **name** (str) – Name previously assigned to the detail frame. ### delete_listview_menu Deletes the menu item, with the given name, from the list view menu. **Parameters** - **name** (str) – Name of the menu item (e.g. ‘Open’). ### destroy Destructor. ### find_subdirs_async Asynchronously executes callback on list of subdirectories at given url. **Parameters** - **url** (str) – Url. - **callback** (Callable) – On success executes this callback with the list of subdir names. Function signature: void callback(subdirs: List[str]) ### find_subdirs_with_callback Executes callback on list of subdirectories at given url. **Parameters** - **url** (str) – Url. - **callback** (Callable) – On success executes this callback with the list of subdir names. Function signature: void callback(subdirs: List[str]) ### get_current_directory Returns the current directory from the browser bar. **Returns** - The system path, which may be different from the displayed path. ### get_current_selections Returns current selected as list of system path names. **Parameters** - **pane** (int) – Specifies pane to retrieve selections from, one of {TREEVIEW_PANE = 1, LISTVIEW_PANE = 2, BOTH = None}. Default LISTVIEW_PANE. **Returns** - List of system paths (which may be different from displayed paths, e.g. bookmarks) **Return type** - [str] ### get_filename Returns currently selected filename. **Return type** - str ### hide_loading_pane Hide the loading icon if it exists. ### navigate_to Navigates to the given url, expanding all parent directories in the path. **Parameters** - **url** (str) – The url to navigate to. - **callback** (Callable) – On successfully finding the item, executes this callback. Function signature: void callback(item: FileBrowserItem) ### navigate_to_async async navigate_to_async(url: str) ### navigate_to_async Asynchronously navigates to the given url, expanding the all parent directories in the path. #### Parameters - **url** (`str`) – The url to navigate to. - **callback** (`Callable`) – On successfully finding the item, executes this callback. Function signature: `void callback(item: FileBrowserItem)` ### refresh_current_directory Refreshes the current directory set in the browser bar. ### remove_collection Remove custom collection from current content view. #### Parameters - **collection_id** (`str`) – Data id to remove. ### remove_show_only_collection Remove the collection filter #### Parameters - **collection_id** (`str`) – The filter that previously added. ### select_items_async Asynchronously selects the specified items. #### Parameters - **url** (`str`) – The url to navigate to. - **filenames** (`List[str]`) – The filenames to select, defaults to `[]` #### Returns - `List[str]` ### Asynchronously select one or more items in the content view. #### Parameters - **url** (str) – Url. #### Keyword Arguments - **filenames** (List[str]) – A list of file names that to be selected ### Procedurally sets the current directory. Use this method to set the path in the browser bar. #### Parameters - **path** (str) – The full path name of the folder, e.g. “omniverse://ov-content/Users/me. ### Sets the filename in the file bar, at bottom of the dialog. The file is not required to already exist. #### Parameters - **filename** (str) – The filename only (and not the fullpath), e.g. “myfile.usd”. ### Sets a custom search delegate for the tool bar. #### Parameters - **delegate** (SearchDelegate) – Object that creates the search widget. ### Displays the given model in the list view, overriding the default model. For example, this model might be the result of a search. #### Parameters - **model** (FileBrowserModel) – Model to display. ### Subscribe to omni.client bookmark changes. ### toggle_bookmark_from_path(name: str, path: str, is_bookmark: bool, is_folder: bool = True) Adds/deletes the given bookmark with the specified path. If deleting, then the path argument is optional. #### Parameters - **name** (str) – Name to call the bookmark or existing name if delete. - **path** (str) – Path to the bookmark. - **is_bookmark** (bool) – True to add, False to delete. - **is_folder** (bool) – Whether the item to be bookmarked is a folder.
omni.kit.window.filepicker.FilePickerDialog.md
# FilePickerDialog ## FilePickerDialog ``` class omni.kit.window.filepicker.FilePickerDialog(title: str, **kwargs) ``` Bases: `object` A popup window for browsing the filesystem and taking action on a selected file. Includes a browser bar for keyboard input with auto-completion for navigation of the tree view. For similar but different options, see also `FilePickerWidget` and `FilePickerView`. ### Parameters - **title** (str) – Window title. Default None. ### Keyword Arguments - **width** (int) – Window width. Default 1000. - **height** (int) – Window height. Default 600. - **click_apply_handler** (Callable) – Function that will be called when the user accepts the selection. Function signature: apply_handler(file_name: str, dir_name: str) -> None. - **click_cancel_handler** (Callable) – Function that will be called when the user clicks the cancel button. Function signature: cancel_handler(file_name: str, dir_name: str) -> None. - **other** – Additional args listed for `FilePickerWidget`. ### Methods ``` | Method Name | Description | |-------------|-------------| | `__init__(title, **kwargs)` | | | `add_connections(connections)` | Adds specified server connections to the browser. | | `add_detail_frame_from_controller(name, ...)` | Adds subsection to the detail view, and populate it with a custom built widget. | | `delete_detail_frame(name)` | Deletes the named detail frame. | | `destroy()` | Destructor. | | `get_current_directory()` | Returns the current directory from the browser bar. | | `get_current_selections([pane])` | Returns current selected as list of system path names. | | `get_file_extension()` | Currently selected filename extension. | | `get_file_extension_options()` | List of all extension options strings. | | `get_file_postfix()` | Currently selected postfix. | | `get_file_postfix_options()` | List of all postfix strings. | | `get_filebar_label_name()` | Currently text of name label for file bar. | | `get_filename()` | | - `get_filename()` - Returns: Currently selected filename. - `hide()` - Hides this dialog. - `navigate_to(path)` - Navigates to a path, i.e. the path's parent directory will be expanded and leaf selected. - `refresh_current_directory()` - Refreshes the current directory set in the browser bar. - `set_click_apply_handler(click_apply_handler)` - Sets the function to execute upon clicking apply. - `set_current_directory(path)` - Procedurally sets the current directory path. - `set_file_extension(extension)` - Sets the file extension in the file bar. - `set_file_postfix(postfix)` - Sets the file postfix in the file bar. - `set_filebar_label_name(name)` - Sets the text of the name label for filebar, at the bottom of dialog. - `set_filename(filename)` - Sets the filename in the file bar, at bottom of the dialog. - `set_item_filter_fn(item_filter_fn)` - Sets the item filter function. - `set_search_delegate(delegate)` - Sets a custom search delegate for the tool bar. - `set_visibility_changed_listener(listener)` - Call the given handler when window visibility is changed. - `show([path])` - Shows this dialog. - `show_model()` - (Description not provided in HTML) ### Functions - **show_model** *(model)* - Displays the given model in the list view, overriding the default model. - **toggle_bookmark_from_path** *(name, path, ...[, ...])* - Adds/deletes the given bookmark with the specified path. ### Attributes - **current_filter_option** - Index of current filter option, range 0. ### Methods - **__init__** *(title: str, **kwargs)* - Initialize the dialog with a title and additional keyword arguments. - **add_connections** *(connections: dict)* - Adds specified server connections to the browser. - Parameters: - **connections** *(dict)* – A dictionary of name, path pairs. For example: {"C:": "C:", "ov-content": "omniverse://ov-content"}. Paths to Omniverse servers should be prefixed with "omniverse://". - **add_detail_frame_from_controller** *(name: str, controller: DetailFrameController)* - Adds subsection to the detail view, and populate it with a custom built widget. - Parameters: - **name** *(str)* – Name of the widget sub-section, this name must be unique over all detail sub-sections. - **controller** *(DetailFrameController)* – Controller object that encapsulates all aspects of creating, updating, and deleting a detail frame widget. - Returns: - Handle to created widget. - Return type: - ui.Widget - **delete_detail_frame** *(name: str)* - Deletes the detail frame with the specified name. - Parameters: - **name** *(str)* – Name of the detail frame to be deleted. <em class="sig-param"> <span class="n"> <span class="pre"> name </span> </span> <span class="p"> <span class="pre"> :</span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> str </span> </span> </em> <span class="sig-paren"> )</span> </span> </dt> <dd> <p> Deletes the named detail frame. </p> <dl class="field-list simple"> <dt class="field-odd"> Parameters </dt> <dd class="field-odd"> <p> <strong> name </strong> ( <em> str </em> ) – Name of the frame. </p> </dd> </dl> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.filepicker.FilePickerDialog.destroy"> <span class="sig-name descname"> <span class="pre"> destroy </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> )</span> </span> </dt> <dd> <p> Destructor. </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.filepicker.FilePickerDialog.get_current_directory"> <span class="sig-name descname"> <span class="pre"> get_current_directory </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> )</span> </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> str </span> </span> </span> </dt> <dd> <p> Returns the current directory from the browser bar. </p> <dl class="field-list simple"> <dt class="field-odd"> Returns </dt> <dd class="field-odd"> <p> The system path, which may be different from the displayed path. </p> </dd> <dt class="field-even"> Return type </dt> <dd class="field-even"> <p> str </p> </dd> </dl> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.filepicker.FilePickerDialog.get_current_selections"> <span class="sig-name descname"> <span class="pre"> get_current_selections </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> pane </span> </span> <span class="p"> <span class="pre"> :</span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> int </span> </span> <span class="w"> </span> <span class="o"> <span class="pre"> =</span> </span> <span class="w"> </span> <span class="default_value"> <span class="pre"> 2 </span> </span> </span> </em> <span class="sig-paren"> )</span> </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> List </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> str </span> <span class="p"> <span class="pre"> ]</span> </span> </span> </span> </dt> <dd> <p> Returns current selected as list of system path names. </p> <dl class="field-list simple"> <dt class="field-odd"> Parameters </dt> <dd class="field-odd"> <p> <strong> pane </strong> ( <em> int </em> ) – Specifies pane to retrieve selections from, one of {TREEVIEW_PANE = 1, LISTVIEW_PANE = 2, BOTH = None}. Default LISTVIEW_PANE. </p> </dd> <dt class="field-even"> Returns </dt> <dd class="field-even"> <p> List of system paths (which may be different from displayed paths, e.g. bookmarks) </p> </dd> <dt class="field-odd"> Return type </dt> <dd class="field-odd"> <p> [str] </p> </dd> </dl> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.filepicker.FilePickerDialog.get_file_extension"> <span class="sig-name descname"> <span class="pre"> get_file_extension </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> )</span> </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> str </span> </span> </span> </dt> <dd> <dl class="field-list simple"> <dt class="field-odd"> Returns </dt> <dd class="field-odd"> <p> Currently selected filename extension. </p> </dd> <dt class="field-even"> Return type </dt> <dd class="field-even"> <p> str </p> </dd> </dl> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.filepicker.FilePickerDialog.get_file_extension_options"> <span class="sig-name descname"> <span class="pre"> get_file_extension_options </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> )</span> </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> List </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> Tuple </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> str </span> <span class="p"> <span class="pre"> , </span> </span> <span class="w"> </span> <span class="pre"> str </span> <span class="p"> <span class="pre"> ]</span> </span> </span> </span> </span> </dt> <dd> <dl class="field-list simple"> <dt class="field-odd"> Returns </dt> <dd class="field-odd"> <p> Currently selected filename extension. </p> </dd> <dt class="field-even"> Return type </dt> <dd class="field-even"> <p> str </p> </dd> </dl> </dd> </dl> ### get_file_extension_options **Returns:** List of all extension options strings. **Return type:** List[str] ### get_file_postfix **Returns:** Currently selected postfix. **Return type:** str ### get_file_postfix_options **Returns:** List of all postfix strings. **Return type:** List[str] ### get_filebar_label_name **Returns:** Currently text of name label for file bar. **Return type:** str ### get_filename **Returns:** Currently selected filename. **Return type:** str ### hide Hides this dialog. Automatically called when “Cancel” buttons is clicked. ### navigate_to Navigates to a path, i.e. the path’s parent directory will be expanded and leaf selected. **Parameters:** - **path** (str) – The path to navigate to. ### refresh_current_directory() Refreshes the current directory set in the browser bar. ### set_click_apply_handler(click_apply_handler: Callable[[str, str], None]) Sets the function to execute upon clicking apply. #### Parameters - **click_apply_handler** (Callable) – Callback with filename being the name of the file, and dirname being the containing directory path with an ending slash. Function Signature is fn(filename: str, dirname: str) -> None ### set_current_directory(path: str) Procedurally sets the current directory path. #### Parameters - **path** (str) – The full path name of the folder, e.g. “omniverse://ov-content/Users/me. #### Raises - **RuntimeWarning** – If path doesn’t exist or is unreachable. ### set_file_extension(extension: str) Sets the file extension in the file bar. ### set_file_postfix(postfix: str) Sets the file postfix in the file bar. ### set_filebar_label_name(name: str) Sets the text of the name label for filebar, at the bottom of dialog. #### Parameters - **name** (str) – The text to display as the label name. - **filename** (**str**) – By default, it’s “File name” if it’s not set. For some scenarios that, - **folder** (**it only allows to choose**) – - **UX.** (**it can be configured with this API for better**) – ### set_filename - **Sets the filename in the file bar, at bottom of the dialog.** - **Parameters** - **filename** (**str**) – The filename only (and not the fullpath), e.g. “myfile.usd”. ### set_item_filter_fn - **Sets the item filter function.** - **Parameters** - **item_filter_fn** (**Callable**) – Signature is bool fn(item: FileBrowserItem) ### set_search_delegate - **Sets a custom search delegate for the tool bar.** - **Parameters** - **delegate** (**SearchDelegate**) – Object that creates the search widget. ### set_visibility_changed_listener - **Call the given handler when window visibility is changed.** - **Parameters** - **listener** (**Callable**) – Handler with signature listener[visible: bool). ### show - **...** ## show Shows this dialog. Currently pops up atop all other windows but is not completely modal, i.e. does not take over input focus. ### Parameters - **path** (`str`) – If optional path is specified, then navigates to it upon startup. ## show_model Displays the given model in the list view, overriding the default model. For example, this model might be the result of a search. ### Parameters - **model** (`FileBrowserModel`) – Model to display. ## toggle_bookmark_from_path Adds/deletes the given bookmark with the specified path. If deleting, then the path argument is optional. ### Parameters - **name** (`str`) – Name to call the bookmark or existing name if delete. - **path** (`str`) – Path to the bookmark. - **is_bookmark** (`bool`) – True to add, False to delete. - **is_folder** (`bool`) – Whether the item to be bookmarked is a folder. ## current_filter_option Index of current filter option, range 0 .. num_filter_options. ### Type <p> int </p>
omni.kit.window.filepicker.FilePickerExtension.md
# FilePickerExtension ## FilePickerExtension The filepicker extension is not necessarily integral to using the widget. However, it is useful for handling singleton tasks for the class. ### Methods | Method | Description | | ------ | ----------- | | `on_shutdown()` | | | `on_startup(ext_id)` | | ### `__init__(self: omni.ext._extensions.IExt) -> None`
omni.kit.window.filepicker.FilePickerModel.md
# FilePickerModel ## Methods - `__init__(**kwargs)` - `destroy()` - Destructor - `find_item_async(url[, callback])` - Searches model for the given path and executes callback on found item. - `find_item_in_subtree_async(root, path)` - Finds the given item in the current model recursively asynchronously. - `find_item_with_callback(path)` - Searches model for the given path and executes callback on found item. | Method | Description | |--------|-------------| | `get_badges(item)` | Returns fullpaths to badges for given item. | | `get_icon(item, expanded)` | Returns fullpath to icon for given item. | | `get_thumbnail(item)` | Returns fullpath to thumbnail for given item. | | `is_local_path(path)` | Returns True if given path is a local path | | `sanitize_path(path)` | Helper function for normalizing a path that may have been copied and pasted into browser bar. | ### Attributes | Attribute | Description | |-----------|-------------| | `collections` | The collections loaded for this widget | ### Methods ```python def __init__(**kwargs): pass ``` ```python def destroy(): """ Destructor """ ``` ```python async def find_item_async(url: str, callback: Optional[Callable] = None) -> FileBrowserItem: """ Searches model for the given path and executes callback on found item. Parameters: - url (str): Url of item to search for. - callback (Optional[Callable]): Optional callback function to execute when the item is found. """ ``` ``` ### find_item_in_subtree_async ```python async find_item_in_subtree_async(root: FileBrowserItem, path: str) -> FileBrowserItem ``` Finds the given item in the current model recursively asynchronously. **Parameters:** - **root** (FileBrowserItem): The root item to search. - **path** (str): Path of item to search for. **Returns:** - obj: 'FileBrowserItem': item that has the path and under the root item. --- ### find_item_with_callback ```python find_item_with_callback(url: str, callback: Optional[Callable] = None) ``` Searches filebrowser model for the item with the given url. Executes callback on found item. **Parameters:** - **url** (str): Url of item to search for. - **callback** (Callable): Invokes this callback on found item or None if not found. Function signature is `void callback(item: FileBrowserItem)`. --- ### get_badges ```python get_badges(item: FileBrowserItem) -> List[Tuple[str, str]] ``` Returns fullpaths to badges for given item. Override this method to implement custom badges. **Parameters:** - **item** (FileBrowserItem): The item to get badges for. **Returns:** - List[Tuple[str, str]]: List of tuples containing badge information. ### Parameters - **item** (`FileBrowseritem`) – Item in question. ### Returns - Where each tuple is an (icon path, tooltip string) pair. ### Return type - List[Tuple[str, str]] ### get_icon - **Parameters** - **item** (`FileBrowseritem`) – Item in question. - **expanded** (bool) – True if item is expanded. - **Returns** - str ### get_thumbnail - **Parameters** - **item** (`FileBrowseritem`) – Item in question. - **Returns** - Fullpath to the thumbnail file, None if not found. - **Return type** - str ### is_local_path - **Parameters** - **path** (str) - **Returns** - bool ### sanitize_path - **Parameters** - **path** (str) - **Returns** - str ## Helper Function for Normalizing a Path ### Description Helper function for normalizing a path that may have been copied and pasted into browser bar. This makes the tool more resilient to user inputs from other apps. ### Parameters - **path** (str) – Raw path ### Returns - str ## Property: collections ### Description The collections loaded for this widget ### Type - [FileBrowseItem]
omni.kit.window.filepicker.FilePickerView.md
# FilePickerView ## FilePickerView ``` class omni.kit.window.filepicker.FilePickerView(title: str, **kwargs) ``` Bases: `object` An embeddable UI component for browsing the filesystem. This widget is more full-functioned than `FileBrowserWidget` but less so than `FilePickerWidget`. More specifically, this is one of the 3 sub-components of its namesake `FilePickerWidget`. The difference is it doesn’t have the Browser Bar (at top) or the File Bar (at bottom). This gives users the flexibility to substitute in other surrounding components instead. ### Parameters - **title** (str) – Widget title. Default None. ### Keyword Arguments - **layout** (int) – The overall layout of the window, one of: {LAYOUT_SPLIT_PANES, LAYOUT_SINGLE_PANE_SLIM, LAYOUT_SINGLE_PANE_WIDE, LAYOUT_DEFAULT}. Default LAYOUT_SPLIT_PANES. - **splitter_offset** (int) – Position of vertical splitter bar. Default 300. - **show_grid_view** (bool) – Display grid view in the intial layout. Default True. - **show_recycle_widget** (bool) – Display recycle widget in the intial layout. Default False. - **grid_view_scale** (int) – ``` - **scales_grid_view** (`Callable`) – Scales grid view, ranges from 0-5. Default 2. - **on_toggle_grid_view_fn** (`Callable`) – Callback after toggle grid view is executed. Default None. - **on_scale_grid_view_fn** (`Callable`) – Callback after scale grid view is executed. Default None. - **show_only_collections** (`list[str]`) – List of collections to display, any combination of ["bookmarks", "omniverse", "my-computer"]. If None, then all are displayed. Default None. - **tooltip** (`bool`) – Display tooltips when hovering over items. Default True. - **allow_multi_selection** (`bool`) – Allow multiple items to be selected at once. Default False. - **mouse_pressed_fn** (`Callable`) – Function called on mouse press. Function signature: void mouse_pressed_fn(pane: int, button: int, key_mode: int, item: FileBrowserItem) - **mouse_double_clicked_fn** (`Callable`) – Function called on mouse double click. Function signature: void mouse_double_clicked_fn(pane: int, button: int, key_mode: int, item: FileBrowserItem) - **selection_changed_fn** (`Callable`) – Function called when selection changed. Function signature: void selection_changed_fn(pane: int, selections: list[FileBrowserItem]) - **drop_handler** (`Callable`) – Function called to handle drag-n-drops. Function signature: void drop_fn(dst_item: FileBrowserItem, src_paths: [str]) - **item_filter_fn** (`Callable`) – This handler should return True if the given tree view item is visible, False otherwise. Function signature: bool item_filter_fn(item: FileBrowserItem) - **thumbnail_provider** (`Callable`) – This callback returns the path to the item’s thumbnail. If not specified, then a default thumbnail is used. Signature: str thumbnail_provider(item: FileBrowserItem). - **icon_provider** (`Callable`) – This callback provides an icon to replace the default in the tree view. Signature str icon_provider(item: FileBrowserItem) - **badges_provider** (`Callable`) – This callback provides the list of badges to layer atop the thumbnail in the grid view. Callback signature: [str] badges_provider(item: FileBrowserItem) - **treeview_identifier** (`str`) – widget identifier for treeview, only used by tests. - **enable_zoombar** (`bool`) – Enables/disables zoombar. Default True. ### Methods - `__init__(title, **kwargs)` - `add_bookmark(name, path[, is_folder, ...])` - Creates a FileBrowserModel rooted at the given path, and connects its subtree to the tree view. - `add_custom_collection(collection_data)` - `add_server()` - `add_server`(name, path[, publish_event, ...]) - Creates a `FileBrowserModel` rooted at the given path, and connects its subtree to the tree view. - `all_collection_items`([collection]) - Returns all connections as items for the specified collection. - `delete_bookmark`(item[, publish_event]) - Deletes the given bookmark. - `delete_server`(item[, publish_event]) - Disconnects the subtree rooted at the given item. - `destroy`() - Destructor - `get_connection_with_url`(url) - Gets the connection item with the given url. - `get_root`([pane]) - Returns the root item of the specified pane. - `get_selections`([pane]) - Returns list of currently selected items. - `has_connection_with_name`(name[, collection]) - Returns True if named connection exists within the collection. - `hide_notification`() - Utility to hide the notification frame. - `is_bookmark`(item[, path]) - Returns true if given item is a bookmarked item, or if a given path is bookmarked. - `is_collection_node`(item) - Returns true if given item is a collection node. - `is_collection_root`([url]) - Returns True if the given url is a collection root url. - `is_connected`(url) - Check if a server is connected. - `is_connection_point`(item) - Returns true if given item is a connection point. - `is_connection_point` (item) - Returns true if given item is a direct child of a collection node. - `is_local_point` (item) - Returns true if given item is a direct child of a my-computer's node. - `log_out_server` (item) - Log out from the server at the given path. - `mount_user_folders` (folders) - Mounts given set of user folders under the local collection. - `reconnect_server` (item) - Reconnects the server at the given path. - `refresh_ui` ([item]) - Redraws the subtree rooted at the given item. - `remove_collection` (collection_id) - - `rename_bookmark` (item, new_name, new_url[, ...]) - Renames the bookmark item. - `rename_server` (item, new_name[, publish_event]) - Renames the connection item. - `scale_grid_view` (scale) - Scale file picker's grid view icon size. - `select_and_center` (item) - Selects and centers the view on the given item, expanding the tree if needed. - `set_item_filter_fn` (item_filter_fn) - Sets the item filter function. - `set_selections` (selections[, pane]) - Selected given items in given pane. - `show_connect_dialog` () - Displays the add connection dialog. - `show_model` (model) - Displays the model on the right side of the split pane | Method | Description | | ------ | ----------- | | `show_notification()` | Utility to show the notification frame. | | `toggle_grid_view(show_grid_view)` | Toggles file picker between grid and list view. | ### Attributes | Attribute | Description | | --------- | ----------- | | `collections` | Dictionary of collections, e.g. | | `filebrowser` | Gets the filebrowser of this view. | | `notification_frame` | The notification frame. | | `show_grid_view` | Gets file picker stage of grid or list view. | | `show_only_collections` | Gets the collections list only to show. | | `show_udim_sequence` | Whether or not to show UDIM sequence. | ### Methods #### `__init__(title: str, **kwargs)` #### `add_bookmark(name: str, path: str, is_folder: bool = True, publish_event: bool = True)` ### add_bookmark ```python add_bookmark(name: str, path: str, is_folder: bool = True, publish_event: bool = True) -> BookmarkItem ``` Creates a `FileBrowserModel` rooted at the given path, and connects its subtree to the tree view. #### Parameters - **name** (str) – Name of the bookmark. - **path** (str) – Fullpath of the connection, e.g. “omniverse://ov-content”. Paths to Omniverse servers should contain the prefix, “omniverse://”. - **is_folder** (bool) – If the item to be bookmarked is a folder or not. Default to True. - **publish_event** (bool) – If True, push a notification to the event stream. #### Returns `BookmarkItem` ### add_server ```python add_server(name: str, path: str, publish_event: bool = True, auto_select: bool = True) -> FileBrowserModel ``` Creates a `FileBrowserModel` rooted at the given path, and connects its subtree to the tree view. #### Parameters - **name** (str) – Name, label really, of the connection. - **path** (str) – Fullpath of the connection, e.g. “omniverse://ov-content”. Paths to Omniverse servers should contain the prefix, “omniverse://”. - **publish_event** (bool) – If True, push a notification to the event stream. #### Returns `FileBrowserModel` #### Raises - **RuntimeWarning** – If unable to add server. ### all_collection_items Returns all connections as items for the specified collection. If collection is ‘None’, then return connections from all collections. #### Parameters - **collection** (`str`) – One of [‘bookmarks’, ‘omniverse’, ‘my-computer’]. Default None. #### Returns - All connections found. #### Return type - `List[FileBrowserItem]` ### delete_bookmark Deletes the given bookmark. #### Parameters - **item** (`FileBrowserItem`) – Bookmark item. - **publish_event** (`bool`) – If True, push a notification to the event stream. ### delete_server Disconnects the subtree rooted at the given item. #### Parameters - **item** (`FileBrowserItem`) – Root of subtree to disconnect. - **publish_event** (`bool`) – If True, push a notification to the event stream. ### destroy ### Destructor ### get_connection_with_url ```python get_connection_with_url(url: str) -> Optional[NucleusConnectionItem] ``` Gets the connection item with the given url. **Parameters** - **name** (str) – name (could be aliased name) of connection **Returns** - NucleusConnectionItem ### get_root ```python get_root(pane: Optional[int] = None) -> FileBrowserItem ``` Returns the root item of the specified pane. **Parameters** - **pane** (int) – One of {TREEVIEW_PANE, LISTVIEW_PANE}. ### get_selections ```python get_selections(pane: int = 2) -> List[FileBrowserItem] ``` Returns list of currently selected items. **Parameters** - **pane** (int) – One of {TREEVIEW_PANE, LISTVIEW_PANE}. **Returns** - list[FileBrowserItem] ### has_connection_with_name ```python has_connection_with_name(name: str, collection: str) ``` ### has_connection_with_name Returns True if named connection exists within the collection. #### Parameters - **name** (str) – name (could be aliased name) of connection - **collection** (str) – One of {‘bookmarks’, ‘omniverse’, ‘my-computer’}. Default None. #### Returns bool ### hide_notification Utility to hide the notification frame. ### is_bookmark Returns true if given item is a bookmarked item, or if a given path is bookmarked. #### Parameters - **item** (FileBrowserItem) – Item in question. - **path** (Optional[str]) – Path in question. #### Returns bool ### is_collection_node Returns true if given item is a collection node. #### Parameters - **item** (FileBrowserItem) – Item in question. #### Returns bool ## is_collection_root Returns True if the given url is a collection root url. ### Parameters - **url** (str) – The url to query. Default None. ### Returns - The result. ### Return type - bool ## is_connected Check if a server is connected. ### Parameters - **url** – The url of the server ### Returns - True if the server is connected, False if not ## is_connection_point Returns true if given item is a direct child of a collection node. ### Parameters - **item** (FileBrowserItem) – Item in question. ### Returns - bool ## is_local_point Returns true if given item is a direct child of a my-computer’s node. ### Parameters - **item** (FileBrowserItem) – Item in question. ### Returns - bool ### Returns - bool ### log_out_server - **Parameters** - **item** (NucleusConnectionItem) – Connection item. - **Description** - Log out from the server at the given path. ### mount_user_folders - **Parameters** - **folders** (dict) – Name, path pairs. - **Description** - Mounts given set of user folders under the local collection. ### reconnect_server - **Parameters** - **item** (FileBrowserItem) – Connection item. - **Description** - Reconnects the server at the given path. Clears out any cached authentication tokens to force the action. ### refresh_ui - **Parameters** - **item** (Optional[FileBrowserItem] = None) – Root of subtree to redraw. Default None, i.e. root. - **Description** - Redraws the subtree rooted at the given item. If item is None, then redraws entire tree. ### rename_bookmark - **Parameters** - **item** (BookmarkItem) - **new_name** (str) - **new_url** (str) - **Description** - Renames a bookmark and updates its URL. ### rename_bookmark Renames the bookmark item. Note: doesn’t change the connection itself, only how it’s labeled in the tree view. #### Parameters - **item** (`FileBrowserItem`) – Bookmark item. - **new_name** (`str`) – New name. - **new_url** (`str`) – New url address. - **publish_event** (`bool`) – If True, push a notification to the event stream. ### rename_server Renames the connection item. Note: doesn’t change the connection itself, only how it’s labeled in the tree view. #### Parameters - **item** (`FileBrowserItem`) – Root of subtree to disconnect. - **new_name** (`str`) – New name. - **publish_event** (`bool`) – If True, push a notification to the event stream. ### scale_grid_view Scale file picker’s grid view icon size. #### Parameters - **scale** (`float`) – Scale of the icon. ### select_and_center ### select_and_center Selects and centers the view on the given item, expanding the tree if needed. #### Parameters - **item** (`FileBrowserItem`) – The selected item. ### set_item_filter_fn Sets the item filter function. #### Parameters - **item_filter_fn** (`Callable`) – Signature is bool fn(item: FileBrowserItem) ### set_selections Selected given items in given pane. #### Parameters - **selections** (list[`FileBrowserItem`]) – list of selections. - **pane** (`int`) – One of TREEVIEW_PANE, LISTVIEW_PANE, or None for both. Default None. ### show_connect_dialog Displays the add connection dialog. ### show_model Displays the model on the right side of the split pane ### show_notification Utility to show the notification frame. ## toggle_grid_view - **Function**: toggle_grid_view(show_grid_view: bool) - **Description**: Toggles file picker between grid and list view. - **Parameters**: - **show_grid_view** (bool) – True to show grid view, False to show list view. ## collections - **Property**: property collections - **Description**: Dictionary of collections, e.g. ‘bookmarks’, ‘omniverse’, ‘my-computer’. - **Type**: dict ## filebrowser - **Property**: property filebrowser - **Description**: Gets the filebrowser of this view. ## notification_frame - **Property**: property notification_frame - **Description**: The notification frame. ## show_grid_view - **Property**: property show_grid_view - **Description**: Gets file picker stage of grid or list view. - **Returns**: - True if grid view shown or False if list view shown. - **Return type**: bool ## show_only_collections - **Property**: property show_only_collections - **Description**: Gets the collections list only to show. ## show_udim_sequence - **Property**: property show_udim_sequence - **Description**: Whether or not to show UDIM sequence.
omni.kit.window.filepicker.FilePickerWidget.md
# FilePickerWidget ## Overview An embeddable UI widget for browsing the filesystem and taking action on a selected file. Includes a browser bar for keyboard input with auto-completion for navigation of the tree view. For similar but different options, see also `FilePickerDialog` and `FilePickerView`. ### Parameters - **title** (str) – Widget title. Default None. ### Keyword Arguments - **layout** (int) – The overall layout of the window, one of: {LAYOUT_SPLIT_PANES, LAYOUT_SINGLE_PANE_SLIM, LAYOUT_SINGLE_PANE_WIDE, LAYOUT_DEFAULT}. Default LAYOUT_SPLIT_PANES. - **current_directory** (str) – View is set to display this directory. Default None. - **current_filename** (str) – Filename is set to this value. Default None. - **splitter_offset** (int) – Position of vertical splitter bar. Default 300. - **show_grid_view** (bool) – Displays grid view in the initial layout. Default True. - **grid_view_scale** (int) – Scales grid view, ranges from 0-5. Default 2. - **show_only_collections** (List[str]) – Displays only the specified collections. Default None. - **collections** (`List[str]`) – List of collections to display, any combination of ["bookmarks", "omniverse", "my-computer"]. If None, then all are displayed. Default None. - **allow_multi_selection** (`bool`) – Allows multiple selections. Default False. - **click_apply_handler** (`Callable`) – Function that will be called when the user accepts the selection. Function signature: `void apply_handler(file_name: str, dir_name: str)`. - **click_cancel_handler** (`Callable`) – Function that will be called when the user clicks the cancel button. Function signature: `void cancel_handler(file_name: str, dir_name: str)`. - **apply_button_label** (`str`) – Alternative label for the apply button. Default "Okay". - **cancel_button_label** (`str`) – Alternative label for the cancel button. Default "Cancel". - **enable_file_bar** (`bool`) – Enables/disables file bar. Default True. - **enable_filename_input** (`bool`) – Enables/disables filename input. Default True. - **file_postfix_options** (`List[str]`) – A list of filename postfix options. Default []. - **file_extension_options** (`List[Tuple[str, str]]`) – A list of filename extension options. Each list element is an (extension name, description) pair, e.g. (".usdc", "Binary format"). Default []. - **item_filter_options** (`List[str]`) – OBSOLETE. Use file_postfix_options & file_extension_options instead. A list of filter options to determine which files should be listed. For example: ['usd', 'wav']. Default None. - **item_filter_fn** (`Callable`) – This user function should return True if the given tree view item is visible, False otherwise. To base the decision on which filter option is currently chosen, use the attribute filepicker.current_filter_option. Function signature: `bool item_filter_fn(item: FileBrowserItem)` - **error_handler** (`Callable`) – OBSOLETE. This function is called with error messages when appropriate. It provides the calling app a way to display errors on top of writing them to the console window. Function signature: `void error_handler(message: str)`. - **show_detail_view** (`bool`) – Display the details pane. - **enable_versioning_pane** (`bool`) – OBSOLETE. Use enable_checkpoints instead. - **enable_checkpoints** (`bool`) – Whether the checkpoints, a.k.a. versioning pane should be displayed. Default False. - **enable_timestamp** (`bool`) – Whether the show timestamp panel. need show with checkpoint, Default False. - **options_pane_build_fn** (`Callable[[List[FileBrowserItem]], bool]`) – OBSOLETE, add options in a detail frame instead. - **options_pane_width** (`Union[int, omni.ui.Percent]`) – OBSOLETE. - **selection_changed_fn** (`Callable[[List[FileBrowserItem]]]`) – Selections has changed. - **treeview_identifier** (`str`) – widget identifier for treeview, only used by tests. - **enable_tool_bar** (`bool`) – Enables/disables tool bar. Default True. - **enable_zoombar** (`bool`) – Enables/disables filename input. Default True. - **save_grid_view** (`bool`) – Save grid view mode if toggled. Default True. - **apply_path_handler** (`Callable`) – Function that will be called when the user entered in the path field. Function Signature: void apply_path_handler(url: str) ### Methods | Method | Description | | --- | --- | | `__init__(title, **kwargs)` | | | `destroy()` | Destructor. | | `get_selected_filename_and_directory()` | Get the current directory and filename that has been selected or entered into the filename field | | `set_click_apply_handler(click_apply_handler)` | Sets the function to execute upon clicking apply. | | `set_item_filter_fn(item_filter_fn)` | Sets the item filter function. | ### Attributes | Attribute | Description | | --- | --- | | `api` | Provides API methods to this widget. | | `current_filter_option` | Index of current filter option, range 0. | | `file_bar` | Returns the file bar widget. | | `model` | Returns the model of this widget. | #### `__init__(title: str, **kwargs)` #### `destroy()` ### omni.kit.window.filepicker.FilePickerWidget.destroy **Destructor.** ### omni.kit.window.filepicker.FilePickerWidget.get_selected_filename_and_directory **Get the current directory and filename that has been selected or entered into the filename field** ### omni.kit.window.filepicker.FilePickerWidget.set_click_apply_handler **Sets the function to execute upon clicking apply.** **Parameters** - **click_apply_handler** (Callable) – Callback with filename being the name of the file, and dirname being the containing directory path with an ending slash. Signature is fn(filename: str, dirname: str) -> None ### omni.kit.window.filepicker.FilePickerWidget.set_item_filter_fn **Sets the item filter function.** **Parameters** - **item_filter_fn** (Callable) – Signature is bool fn(item: FileBrowserItem) ### omni.kit.window.filepicker.FilePickerWidget.api **Provides API methods to this widget.** **Type** - **FilePickerAPI** ### current_filter_option : int Index of current filter option, range 0 .. num_filter_options. Type ==== OBSOLETE int ### file_bar : FileBar Returns the file bar widget. Type ==== FileBar ### model Returns the model of this widget.
omni.kit.window.filepicker.SearchDelegate.md
# SearchDelegate ## Methods - `__init__()` - `build_ui()` - `destroy()` ## Attributes - `enabled` - Enable/disable Widget - `search_dir` - `visible` ## Property ### enabled Enable/disable Widget
omni.kit.window.filepicker.SearchResultsItem.md
# SearchResultsItem ## SearchResultsItem ```python class omni.kit.window.filepicker.SearchResultsItem(path: str, fields: FileBrowserItemFields, is_folder: bool = False) ``` **Bases:** [FileBrowserItem](<>) ### Methods | Method | Description | |--------|-------------| | `__init__(self)` | | | `get_custom_thumbnails_for_folder_async()` | Returns the thumbnail dictionary for this (folder) item. | ### Attributes | Attribute | Description | |-----------|-------------| <em> <span class="n"> <span class="pre"> self </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> omni.ui._ui.AbstractItem </span> </span> </em> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> None </span> </span> </span> <dt class="sig sig-object py" id="omni.kit.window.filepicker.SearchResultsItem.get_custom_thumbnails_for_folder_async"> <em class="property"> <span class="pre"> async </span> <span class="w"> </span> </em> <span class="sig-name descname"> <span class="pre"> get_custom_thumbnails_for_folder_async </span> </span> <span class="sig-paren"> ( </span> <span class="sig-paren"> ) </span> <span class="sig-return"> <span class="sig-return-icon"> → </span> <span class="sig-return-typehint"> <span class="pre"> Dict </span> </span> </span> <dd> <p> Returns the thumbnail dictionary for this (folder) item. </p> <dl class="field-list simple"> <dt class="field-odd"> Returns </dt> <dd class="field-odd"> <p> With children url’s as keys, and url’s to thumbnail files as values. </p> </dd> <dt class="field-even"> Return type </dt> <dd class="field-even"> <p> Dict </p> </dd> </dl> </dd>
omni.kit.window.filepicker.SearchResultsModel.md
# SearchResultsModel ## Overview The `SearchResultsModel` class is a part of the `omni.kit.window.filepicker` module. It extends the `FileBrowserModel` and provides functionalities related to search results in a file picker interface. ### Constructor ```python class omni.kit.window.filepicker.SearchResultsModel: def __init__(self, search_model: AbstractSearchModel, **kwargs) ``` ### Methods - **`__init__(self)`** - Constructs an instance of `SearchResultsModel`. - **`destroy()`** - Destructor method to clean up resources. - **`get_item_children(item)`** - Returns a list of items that are nested under the given parent item. ### Attributes - None specified in the provided HTML. ### omni.ui._ui.AbstractItemModel Constructs AbstractItemModel. > See below ### Keyword Arguments: ### omni.kit.window.filepicker.SearchResultsModel.destroy Destructor. ### omni.kit.window.filepicker.SearchResultsModel.get_item_children Return the list of items that are nested to the given parent item. #### Parameters - **item** (`FileBrowserItem`) – Parent item. #### Returns - list[`FileBrowserItem`]
omni.kit.window.filepicker.TimestampWidget.md
# TimestampWidget ## Methods - `__init__(**kwargs)` - Timestamp Widget. - `add_on_check_changed_fn(fn)` - Add a function to be called when the check changes. - `create_timestamp_widget()` - Create and return a TimestampWidget. - `delete_timestamp_widget(widget)` - Delete a TimestampWidget. - `destroy()` - Destroy and clean up the widget. - `get_timestamp_url()` - (Description not provided in the HTML snippet) ### Methods - `get_timestamp_url` - Returns the URL to use for the timestamp. - `on_list_checkpoint` (select) - Called when user selects a checkpoint. - `on_selection_changed` (widget, selected) - Callback for when selection changes. - `rebuild` (selected) - Rebuild the frame. - `set_checkpoint_widget` (widget) - Set the checkpoint widget. - `set_url` (url) - Set the url. ### Attributes - `check` - Get check box status of timestamp widget. ### Methods - `__init__` (**kwargs) - Timestamp Widget. - `add_on_check_changed_fn` (fn) - Add a function to be called when the check changes. The function will be called with the following arguments: - Parameters: - `fn` (Callable) – The function to be. - `create_timestamp_widget` - Create and return a TimestampWidget. - Returns: - obj:’TimestampWidget’: A TimestampWidget instance. - `delete_timestamp_widget` (widget) - Delete the timestamp widget. ### TimestampWidget **delete_timestamp_widget** Delete a TimestampWidget. **Parameters** - **widget** (obj:’TimestampWidget’): The widget to be deleted. If None is passed no action is taken ### destroy Destroy and clean up the widget. ### get_timestamp_url Returns the URL to use for the timestamp. **Parameters** - **url** (str) – The url to use. **Returns** - The url with the timestamp appended to it if the timestamp checkbox is checked. **Return type** - str ### on_list_checkpoint Called when user selects a checkpoint. **Parameters** - **select** (str) – selected item. ### on_selection_changed Callback for when selection changes. **Parameters** - **(widget)** (obj:’TimestampWidget’): TimestampWidget that was toggled. - **selected** (List[str]) – List of items that were selected. If None is selected no change is made. <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.filepicker.TimestampWidget.rebuild"> <span class="sig-name descname"> <span class="pre"> rebuild </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> selected </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> List </span> <span class="p"> <span class="pre"> [ </span> </span> <span class="pre"> str </span> <span class="p"> <span class="pre"> ] </span> </span> </span> </em> <span class="sig-paren"> ) </span> </dt> <dd> <p> Rebuild the frame. This is called when the user clicks on the rebuild button. :param selected: List of items that have been selected. :type selected: List[str] </p> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.filepicker.TimestampWidget.set_checkpoint_widget"> <span class="sig-name descname"> <span class="pre"> set_checkpoint_widget </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> widget </span> </span> </em> <span class="sig-paren"> ) </span> </dt> <dd> <p> Set the checkpoint widget. This is used to provide feedback to the user when they want to check out the state of the experiment </p> <dl class="field-list simple"> <dt class="field-odd"> Parameters </dt> <dd class="field-odd"> <p> <strong> widget </strong> ( <em> obj </em> ) – The widget to be </p> </dd> </dl> </dd> </dl> <dl class="py method"> <dt class="sig sig-object py" id="omni.kit.window.filepicker.TimestampWidget.set_url"> <span class="sig-name descname"> <span class="pre"> set_url </span> </span> <span class="sig-paren"> ( </span> <em class="sig-param"> <span class="n"> <span class="pre"> url </span> </span> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="n"> <span class="pre"> str </span> </span> </em> <span class="sig-paren"> ) </span> </dt> <dd> <p> Set the url. </p> <dl class="field-list simple"> <dt class="field-odd"> Parameters </dt> <dd class="field-odd"> <p> <strong> url </strong> ( <em> str </em> ) – The URL to set. </p> </dd> </dl> </dd> </dl> <dl class="py property"> <dt class="sig sig-object py" id="omni.kit.window.filepicker.TimestampWidget.check"> <em class="property"> <span class="pre"> property </span> <span class="w"> </span> </em> <span class="sig-name descname"> <span class="pre"> check </span> </span> <em class="property"> <span class="p"> <span class="pre"> : </span> </span> <span class="w"> </span> <span class="pre"> bool </span> </em> </dt> <dd> <p> Get check box status of timestamp widget. :returns: True if the timestamp is valid False otherwise. :rtype: bool </p> </dd> </dl>
omni.kit.window.filepicker.ToolBar.md
# ToolBar ## ToolBar ```python class omni.kit.window.filepicker.ToolBar(**kwargs) ``` Bases: `object` ### Methods - **`__init__(**kwargs)`** - **`destroy()`** - Destroy the widget. - **`set_bookmarked(true_false)`** - Set whether or not the bookmark image should be shown. - **`set_config_value(name, value)`** - Set a value for a config button. - **`set_path(path)`** - Sets the path to search for. - **`set_search_delegate(delegate)`** - Set the delegate for handling search operations. | Attribute | Description | |-----------|-------------| | `SAVED_SETTINGS_OPTIONS_MENU` | Build a ToolBar for file picker widget. | | `bookmarked` | Whether or not the current path is bookmarked. | | `config_values` | Returns the values of the configuration button. | | `path` | Path to the currently displayed file. | ### Attributes | Attribute | Description | |-----------|-------------| | `SAVED_SETTINGS_OPTIONS_MENU` | Build a ToolBar for file picker widget. | | `bookmarked` | Whether or not the current path is bookmarked. | | `config_values` | Returns the values of the configuration button. | | `path` | Path to the currently displayed file. | ### Methods #### `__init__(**kwargs)` #### `destroy()` Destroy the widget. #### `set_bookmarked(true_false: bool)` Set whether or not the bookmark image should be shown. - **Parameters** - **true_false** (bool) – True if the bookmark image should be shown else False. #### `set_config_value(name: str, value: bool)` Set a value for a config button. - **Parameters** - **name** (str) – The name of the value to set. - **value** (bool) – The value to set for the name. #### `set_path(path: str)` ### set_path Sets the path to search for. #### Parameters - **path** (str) – The path to search ### set_search_delegate Sets a custom search delegate for the tool bar. #### Parameters - **delegate** (SearchDelegate) – Object that creates the search widget. ### SAVED_SETTINGS_OPTIONS_MENU Build a ToolBar for file picker widget. #### Keyword Arguments - **current_directory_provider** (Optional[Callable]) – A provider for the current directory. - **branching_options_handler** (Optional[Callable]) – A handler for branching options. - **apply_path_handler** (Optional[Callable]) – A handler for applying a path. - **toggle_bookmark_handler** (Optional[Callable]) – A handler for toggling bookmarks. - **config_values_changed_handler** (Optional[Callable]) – A handler for handling changes in configuration values. - **begin_edit_handler** (Optional[Callable]) – A handler for starting an edit operation. - **prefix_separator** (Optional[str]) – A separator for prefixes. - **enable_soft_delete** (bool) – A flag indicating whether soft delete is enabled (default: False). - **search_delegate** (Optional[SearchDelegate]) – A delegate for search functionality. - **modal** (bool) – A flag indicating whether the toolbar is modal (default: False). ### bookmarked ### Omni.Kit.Window.FilePicker.ToolBar.Bookmarked - **Description**: Whether or not the current path is bookmarked. - **Returns**: True if the current path is bookmarked else False. - **Return type**: bool ### Omni.Kit.Window.FilePicker.ToolBar.Config_Values - **Description**: Returns the values of the configuration button. - **Returns**: A dictionary of the configuration button values - **Return type**: Dict[str, bool] ### Omni.Kit.Window.FilePicker.ToolBar.Path - **Description**: Path to the currently displayed file. - **Returns**: Path to the currently displayed file or None if there is no browser bar. - **Return type**: str
omni.kit.window.filepicker.UdimContextMenu.md
# UdimContextMenu ## UdimContextMenu Creates popup menu for the hovered FileBrowserItem that are Udim nodes. ### Methods - `__init__(**kwargs)` - Initialize the BaseContextMenu. ### Attributes ### `__init__(**kwargs)` Initialize the BaseContextMenu. #### Keyword Arguments - `title` (Optional [str]) – The title of the context menu default `None`.
omni.kit.window.file_exporter.Classes.md
# omni.kit.window.file_exporter Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | [FileExporterExtension](omni.kit.window.file_exporter/omni.kit.window.file_exporter.FileExporterExtension.html) | A Standardized file export dialog. |
omni.kit.window.file_exporter.FileExporterExtension.md
# FileExporterExtension ## Class omni.kit.window.file_exporter.FileExporterExtension - **Bases:** `IExt` - **Description:** 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 programmatically execute the apply callback. - **`click_cancel([cancel_handler])`** - Helper function to programmatically execute the cancel callback. - **`destroy_dialog()`** - **`detach_from_main_window()`** <p> Detach the current file importer dialog from main window. </p> <p> hide_window() </p> <p> Hides and destroys the dialog window. </p> <p> on_shutdown() </p> <p> on_startup(ext_id) </p> <p> select_items_async(url[, filenames]) </p> <p> Helper function to programmatically select multiple items in filepicker. </p> <p> show_window([title, width, height, ...]) </p> <p> Displays the export dialog with the specified settings. </p> <p> is_ui_ready </p> <p> is_window_visible </p> <p> __init__(self: omni.ext._extensions.IExt) -> None </p> <p> add_export_options_frame(name: str, delegate: DetailFrameController) </p> <p> Adds a set of export options to the dialog. Should be called after show_window. </p> <p> 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. </p> <p> click_apply(filename_url: Optional[str]) </p> ### Function Definitions #### click_apply ```python click_apply( prefix: Optional[str] = None, postfix: Optional[str] = None, extension: Optional[str] = None ) ``` Helper function to programmatically execute the apply callback. Useful in unittests #### click_cancel ```python click_cancel( cancel_handler: Optional[Callable[[str, str], None]] = None ) ``` Helper function to programmatically execute the cancel callback. Useful in unittests #### detach_from_main_window ```python detach_from_main_window() ``` Detach the current file importer dialog from main window. #### hide_window ```python hide_window() ``` Hides and destroys the dialog window. #### select_items_async ```python async select_items_async( url: str, filenames: List[str] ) ``` ### select_items_async Helper function to programmatically select multiple items in filepicker. Useful in unittests. ### show_window ```python 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]]] = None ) ``` 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 focus_filename_input : bool = True click_cancel_handler : Optional[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.
omni.kit.window.file_exporter.Functions.md
# omni.kit.window.file_exporter Functions ## Functions Summary - **get_file_exporter** - Description: Returns the singleton file_exporter extension instance
omni.kit.window.file_exporter.get_file_exporter.md
# get_file_exporter Returns the singleton file_exporter extension instance ## Description ```python omni.kit.window.file_exporter.get_file_exporter() ``` - **Returns**: - `FileExporterExtension` ```
omni.kit.window.file_exporter.md
# omni.kit.window.file_exporter ## Classes Summary - **FileExporterExtension**: A Standardized file export dialog. ## Functions Summary - **get_file_exporter**: Returns the singleton file_exporter extension instance
omni.kit.window.file_importer.Classes.md
# omni.kit.window.file_importer Classes ## Classes Summary - **FileImporterExtension** - A Standardized file import dialog.
omni.kit.window.file_importer.FileImporterExtension.md
# FileImporterExtension ## Overview A Standardized file import dialog. ### Methods - `__init__(self)` - `add_import_options_frame(name, delegate)` - Adds a set of import options to the dialog. - `click_apply([filename_url, postfix, extension])` - Helper function to programmatically execute the apply callback. - `click_cancel([cancel_handler])` - Helper function to programmatically execute the cancel callback. - `destroy_dialog()` - `detach_from_main_window()` Detach the current file importer dialog from main window. ```python hide_window() ``` Hides and destroys the dialog window. ```python on_shutdown() ``` ```python on_startup(ext_id) ``` ```python select_items_async(url[, filenames]) ``` Helper function to programmatically select multiple items in filepicker. ```python show_window([title, width, height, ...]) ``` Displays the import dialog with the specified settings. ### Attributes ```python is_ui_ready ``` ```python is_window_visible ``` ```python __init__(self: omni.ext._extensions.IExt) -> None ``` ```python add_import_options_frame(name: str, delegate: DetailFrameController) ``` Adds a set of import options to the dialog. Should be called after show_window. Parameters: - **name** (str) – Title of the options box. - **delegate** (ImportOptionsDelegate) – Subclasses specified delegate and overrides the _build_ui_impl method to provide a custom widget for getting user input. ```python click_apply(filename_url: Optional[str]) ``` Helper function to progammatically execute the apply callback. Useful in unittests Helper function to progammatically execute the cancel callback. Useful in unittests Detach the current file importer dialog from main window. Hides and destroys the dialog window. ### FileImporterExtension.select_items_async Helper function to programmatically select multiple items in filepicker. Useful in unittests. ### FileImporterExtension.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]]] = None str , str ] ] ] = None , file_filter_handler: Optional[Callable[[str, str, str], bool]] = None , import_button_label: str = 'Import' , import_handler: Optional[Callable[[str, str, List[str]], None]] = None , filename_url: Optional[str] = None , file_postfix: Optional[str] = None None, **file_extension** : Optional[str] = None, **hide_window_on_import** : bool = True, **should_validate** : bool = False, **focus_filename_input** : bool = True, **allow_multi_files_selection** : bool = False ) Displays the import 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. (“.usd”, “USD format”). Nvidia defaults. * **file_filter_handler** (Callable) – The filter handler that is called to decide whether or not to display a file. Function signature is filter_handler(filename: str, filter_postfix: str, filter_ext: str) -> bool * **import_button_label** (str) – Label for the import button (Default=”Import”) * **import_handler** (str) – Label for the import button (Default=”Import”) - **Callable** – The callback to handle the import, filename is the name of the file, and dirname being the containing directory path with a ending slash. Function signature is `import_handler(filename: str, dirname: str, selections: List[str]) -> None` - **filename_url** (str) – Url of the file to import, if any. - **file_postfix** (str) – Sets selected postfix to this value if specified. - **file_extension** (str) – Sets selected extension to this value if specified. - **hide_window_on_import** (bool) – Whether the dialog hides on apply; if False, it means that whether to hide the dialog should be decided by import handler. - **should_validate** (bool) – Whether filename validation should be performed.
omni.kit.window.file_importer.Functions.md
# omni.kit.window.file_importer Functions ## Functions Summary - **get_file_importer** - Returns the singleton file_importer extension instance
omni.kit.window.file_importer.get_file_importer.md
# get_file_importer ## get_file_importer Returns the singleton file_importer extension instance
omni.kit.window.file_importer.md
# omni.kit.window.file_importer ## Classes Summary: | Class | Description | |-------|-------------| | [FileImporterExtension](omni.kit.window.file_importer/omni.kit.window.file_importer.FileImporterExtension.html) | A Standardized file import dialog. | ## Functions Summary: | Function | Description | |----------|-------------| | [get_file_importer](omni.kit.window.file_importer/omni.kit.window.file_importer.get_file_importer.html) | Returns the singleton file_importer extension instance |
omni.kit.window.inspector.Classes.md
# omni.kit.window.inspector Classes ## Classes Summary - **InspectorExtension** - The entry point for Inspector Window
omni.kit.window.inspector.demo_window.Classes.md
# omni.kit.window.inspector.demo_window Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | [InspectorDemoWindow](omni.kit.window.inspector.demo_window/omni.kit.window.inspector.demo_window.InspectorDemoWindow.html) | The demo window for the inspector |
omni.kit.window.inspector.demo_window.InspectorDemoWindow.md
# InspectorDemoWindow ## InspectorDemoWindow ```python class omni.kit.window.inspector.demo_window.InspectorDemoWindow: """ Bases: object The demo window for the inspector """ def __init__(self): pass def destroy(self): pass window = None ``` ```
omni.kit.window.inspector.demo_window.md
# omni.kit.window.inspector.demo_window ## Classes Summary - **InspectorDemoWindow** - The demo window for the inspector
omni.kit.window.inspector.extension.Classes.md
# omni.kit.window.inspector.extension Classes ## Classes Summary - **InspectorExtension** - The entry point for Inspector Window - **InspectorWindow** - The inspector window - **MenuHelperExtension** - Simple helper class for adding/removing “Window” menu to your extension. ui.Window creation/show/hide is still down to user to provide functionally.
omni.kit.window.inspector.extension.InspectorExtension.md
# InspectorExtension ## Methods - `on_shutdown()` - `on_startup()` - `show_window(value)` ## Attributes - `MENU_GROUP` - `MENU_NAME` ### `__init__(self)` omni.ext._extensions.IExt() → None
omni.kit.window.inspector.extension.InspectorWindow.md
# InspectorWindow ## InspectorWindow ```python class omni.kit.window.inspector.extension.InspectorWindow ``` The inspector window ### Methods | Method | Description | |--------|-------------| | `__init__()` | | | `destroy()` | Called by extension before destroying this object. | | `set_visibility_changed_fn(func)` | | #### `__init__()` #### `destroy()` Called by extension before destroying this object. It doesn’t happen automatically. Without this hot reloading doesn’t work. ```
omni.kit.window.inspector.extension.MenuHelperExtension.md
# MenuHelperExtension ## MenuHelperExtension ```python class omni.kit.window.inspector.extension.MenuHelperExtension ``` Simple helper class for adding/removing “Window” menu to your extension. ui.Window creation/show/hide is still down to user to provide functionally. ### Methods | Method | Description | |-----------------------|-------------| | `__init__()` | | | `menu_refresh()` | | | `menu_shutdown()` | | | `menu_startup(window_name, menu_desc, menu_group)` | | ```python def __init__(): ``` ```
omni.kit.window.inspector.InspectorExtension.md
# InspectorExtension ## Overview The entry point for Inspector Window. ### Methods - `on_shutdown()`: - `on_startup()`: - `show_window(value)`: ### Attributes - `MENU_GROUP`: - `MENU_NAME`: ### Initialization - `__init__(self: omni.ext._extensions.IExt)`: None
omni.kit.window.inspector.inspector_preview.Classes.md
# omni.kit.window.inspector.inspector_preview Classes ## Classes Summary - **InspectorPreview** - The Stage widget
omni.kit.window.inspector.inspector_preview.InspectorPreview.md
# InspectorPreview ## InspectorPreview ```python class omni.kit.window.inspector.inspector_preview.InspectorPreview(window: Window, **kwargs) ``` Bases: `object` The Stage widget ### Methods - `__init__(window, **kwargs)` - `destroy()` - `on_selection_changed(event)` - `set_main_widget(widget)` - `set_widget(widget)` - `toggle_visibility()`
omni.kit.window.inspector.inspector_style.md
# omni.kit.window.inspector.inspector_style ## Module Overview This module provides the styling for the inspector window in Omniverse Kit. ### Detailed Description The `omni.kit.window.inspector.inspector_style` module is responsible for defining the visual appearance and layout of the inspector window within the Omniverse Kit environment. It includes styles for various UI elements such as buttons, text fields, and dropdown menus, ensuring a consistent and intuitive user interface. #### Key Features - **Consistent UI**: Ensures that the inspector window adheres to the overall design guidelines of the Omniverse Kit. - **Customizable**: Allows developers to modify or extend the styles to fit specific project requirements. - **Integration**: Seamlessly integrates with other components of the Omniverse Kit, maintaining a unified look and feel across different modules. #### Usage To use this module, simply import it into your Python scripts where the inspector window is utilized. The styles will automatically apply to the corresponding UI elements. ```python import omni.kit.window.inspector.inspector_style ``` #### Example Here is a simple example demonstrating how to apply the styles provided by this module: ```python # Example code demonstrating the use of inspector_style from omni.kit.window.inspector import InspectorWindow # Create an instance of InspectorWindow inspector = InspectorWindow() # Apply the styles inspector.apply_styles() # Now the inspector window will display with the defined styles inspector.show() ``` This example illustrates the basic usage of the `inspector_style` module, showcasing how it can be integrated into an application to enhance the visual presentation of the inspector window. ### Conclusion The `omni.kit.window.inspector.inspector_style` module is a crucial component for maintaining a consistent and visually appealing inspector window in the Omniverse Kit. Its flexibility and ease of integration make it an essential tool for developers working with the Omniverse platform.
omni.kit.window.inspector.inspector_tests.Functions.md
# omni.kit.window.inspector.inspector_tests Functions ## Functions Summary - **test_change_query** - **test_menu_activation** - **test_select_frame** - **test_widget_tool_button** ### test_change_query ### test_menu_activation ### test_select_frame ### test_widget_tool_button
omni.kit.window.inspector.inspector_tests.test_change_query.md
# test_change_query ## test_change_query
omni.kit.window.inspector.inspector_tests.test_menu_activation.md
# test_menu_activation ## test_menu_activation
omni.kit.window.inspector.inspector_tests.test_select_frame.md
# test_select_frame ## test_select_frame
omni.kit.window.inspector.inspector_tests.test_widget_tool_button.md
# test_widget_tool_button ## test_widget_tool_button
omni.kit.window.inspector.inspector_widget.Classes.md
# omni.kit.window.inspector.inspector_widget Classes ## Classes Summary - [InspectorWidget](#)
omni.kit.window.inspector.inspector_widget.InspectorWidget.md
# InspectorWidget ## Methods - `__init__(window, **kwargs)` - `destroy()` - `update_window(window)` </span> </span> </em> <span class="sig-paren"> ) </span> </dt> <dd> </dd> </dl> </dd> </dl> </section> </div> </div> <footer> <hr/> </footer> </div> </div> </section>
omni.kit.window.inspector.inspector_widget.md
# omni.kit.window.inspector.inspector_widget ## Classes Summary - [InspectorWidget](omni.kit.window.inspector.inspector_widget/omni.kit.window.inspector.inspector_widget.InspectorWidget.html)
omni.kit.window.inspector.inspector_window.Classes.md
# omni.kit.window.inspector.inspector_window Classes ## Classes Summary: | Class | Description | |-------|-------------| | [InspectorWindow](omni.kit.window.inspector.inspector_window/omni.kit.window.inspector.inspector_window.InspectorWindow.html) | The inspector window |
omni.kit.window.inspector.inspector_window.InspectorWindow.md
# InspectorWindow ## InspectorWindow The inspector window ### Methods | Method | Description | |--------|-------------| | `__init__()` | | | `destroy()` | Called by extension before destroying this object. | | `set_visibility_changed_fn(func)` | | #### `__init__()` #### `destroy()` Called by extension before destroying this object. It doesn’t happen automatically. Without this hot reloading doesn’t work. 这是一个段落,包含一个[链接]和一张图片。 ``` ```markdown `这是代码块的内容`
omni.kit.window.inspector.inspector_window.md
# omni.kit.window.inspector.inspector_window ## Classes Summary: - **InspectorWindow** - The inspector window
omni.kit.window.inspector.md
# omni.kit.window.inspector ## Submodules Summary: | Module | Description | |--------|-------------| | [omni.kit.window.inspector.demo_window](omni.kit.window.inspector.demo_window.html) | No submodule docstring provided | | [omni.kit.window.inspector.extension](omni.kit.window.inspector.extension.html) | No submodule docstring provided | | [omni.kit.window.inspector.inspector_preview](omni.kit.window.inspector.inspector_preview.html) | No submodule docstring provided | | [omni.kit.window.inspector.inspector_style](omni.kit.window.inspector.inspector_style.html) | No submodule docstring provided | | [omni.kit.window.inspector.inspector_tests](omni.kit.window.inspector.inspector_tests.html) | No submodule docstring provided | | [omni.kit.window.inspector.inspector_widget](omni.kit.window.inspector.inspector_widget.html) | No submodule docstring provided | | [omni.kit.window.inspector.inspector_window](omni.kit.window.inspector.inspector_window.html) | No submodule docstring provided | | [omni.kit.window.inspector.property](omni.kit.window.inspector.property.html) | No submodule docstring provided | | [omni.kit.window.inspector.style](omni.kit.window.inspector.style.html) | No submodule docstring provided | | [omni.kit.window.inspector.tree](omni.kit.window.inspector.tree.html) | No submodule docstring provided | ## Classes Summary: | Class | Description | |-------|-------------| | [InspectorExtension](omni.kit.window.inspector/omni.kit.window.inspector.InspectorExtension.html) | No class docstring provided | The entry point for Inspector Window ---
omni.kit.window.inspector.property.base_frame.Classes.md
# omni.kit.window.inspector.property.base_frame Classes ## Classes Summary: - **WidgetCollectionFrame**
omni.kit.window.inspector.property.base_frame.md
# omni.kit.window.inspector.property.base_frame ## Classes Summary: - [WidgetCollectionFrame](omni.kit.window.inspector.property.base_frame/omni.kit.window.inspector.property.base_frame.WidgetCollectionFrame.html)
omni.kit.window.inspector.property.create_widget.Classes.md
# omni.kit.window.inspector.property.create_widget Classes ## Classes Summary - **PropertyType** - An enumeration.
omni.kit.window.inspector.property.create_widget.Functions.md
# omni.kit.window.inspector.property.create_widget Functions ## Functions Summary - **create_property_widget** - Create a UI widget connected with a setting. - **get_property_enum_class** - (No description provided)
omni.kit.window.inspector.property.create_widget.md
# omni.kit.window.inspector.property.create_widget ## Classes Summary - **PropertyType** - An enumeration. ## Functions Summary - **create_property_widget** - Create a UI widget connected with a setting. - **get_property_enum_class** - (No description provided)
omni.kit.window.inspector.property.inspector_property_widget.Classes.md
# omni.kit.window.inspector.property.inspector_property_widget Classes ## Classes Summary - **InspectorPropertyWidget** - The Stage widget
omni.kit.window.inspector.property.md
# omni.kit.window.inspector.property ## Submodules Summary: | Submodule | Description | |-----------|-------------| | omni.kit.window.inspector.property.base_frame | No submodule docstring provided | | omni.kit.window.inspector.property.create_widget | No submodule docstring provided | | omni.kit.window.inspector.property.inspector_property_widget | No submodule docstring provided | | omni.kit.window.inspector.property.widget_builder | No submodule docstring provided | | omni.kit.window.inspector.property.widget_model | No submodule docstring provided | | omni.kit.window.inspector.property.widgets | No submodule docstring provided |
omni.kit.window.inspector.property.widgets.md
# omni.kit.window.inspector.property.widgets ## Submodules Summary: | Module | Description | | --- | --- | | [omni.kit.window.inspector.property.widgets.button](omni.kit.window.inspector.property.widgets.button.html) | No submodule docstring provided | | [omni.kit.window.inspector.property.widgets.canvas_frame](omni.kit.window.inspector.property.widgets.canvas_frame.html) | No submodule docstring provided | | [omni.kit.window.inspector.property.widgets.circle](omni.kit.window.inspector.property.widgets.circle.html) | No submodule docstring provided | | [omni.kit.window.inspector.property.widgets.collapsable_frame](omni.kit.window.inspector.property.widgets.collapsable_frame.html) | No submodule docstring provided | | [omni.kit.window.inspector.property.widgets.combox_box](omni.kit.window.inspector.property.widgets.combox_box.html) | No submodule docstring provided | | [omni.kit.window.inspector.property.widgets.frame](omni.kit.window.inspector.property.widgets.frame.html) | No submodule docstring provided | | [omni.kit.window.inspector.property.widgets.grid](omni.kit.window.inspector.property.widgets.grid.html) | No submodule docstring provided | | [omni.kit.window.inspector.property.widgets.image](omni.kit.window.inspector.property.widgets.image.html) | No submodule docstring provided | | [omni.kit.window.inspector.property.widgets.image_with_provider](omni.kit.window.inspector.property.widgets.image_with_provider.html) | No submodule docstring provided | | omni.kit.window.inspector.property.widgets.label | No submodule docstring provided | | --- | --- | | omni.kit.window.inspector.property.widgets.line | No submodule docstring provided | | omni.kit.window.inspector.property.widgets.placer | No submodule docstring provided | | omni.kit.window.inspector.property.widgets.scrolling_frame | No submodule docstring provided | | omni.kit.window.inspector.property.widgets.slider | No submodule docstring provided | | omni.kit.window.inspector.property.widgets.stack | No submodule docstring provided | | omni.kit.window.inspector.property.widgets.string_field | No submodule docstring provided | | omni.kit.window.inspector.property.widgets.tree_view | No submodule docstring provided | | omni.kit.window.inspector.property.widgets.triangle | No submodule docstring provided | | omni.kit.window.inspector.property.widgets.widget | No submodule docstring provided |
omni.kit.window.inspector.property.widget_builder.Classes.md
# omni.kit.window.inspector.property.widget_builder Classes ## Classes Summary: - **PropertyWidgetBuilder**
omni.kit.window.inspector.property.widget_builder.md
# omni.kit.window.inspector.property.widget_builder ## Classes Summary: - **PropertyWidgetBuilder** - [PropertyWidgetBuilder](omni.kit.window.inspector.property.widget_builder/omni.kit.window.inspector.property.widget_builder.PropertyWidgetBuilder.html)
omni.kit.window.inspector.property.widget_model.Classes.md
# omni.kit.window.inspector.property.widget_model Classes ## Classes Summary | Class Name | Description | |------------|-------------| | WidgetComboItemModel | Model for a combo box - for each setting we have a dictionary of key, values | | WidgetComboNameValueItem | The object that is associated with the data entity of the AbstractItemModel. | | WidgetComboValueModel | Model to store a pair (label, value of arbitrary type) for use in a ComboBox | | WidgetModel | Model for widget Properties |
omni.kit.window.inspector.style.md
# omni.kit.window.inspector.style ## Submodules Summary: | Module | Description | | --- | --- | | omni.kit.window.inspector.style.resolved_style | No submodule docstring provided | | omni.kit.window.inspector.style.style_delegate | No submodule docstring provided | | omni.kit.window.inspector.style.style_model | No submodule docstring provided | | omni.kit.window.inspector.style.style_tree | No submodule docstring provided | | omni.kit.window.inspector.style.widget_styles | No submodule docstring provided |
omni.kit.window.inspector.style.resolved_style.Classes.md
# omni.kit.window.inspector.style.resolved_style Classes ## Classes Summary - **ResolvedStyleWidget** - The Stage widget
omni.kit.window.inspector.style.style_delegate.Classes.md
# omni.kit.window.inspector.style.style_delegate Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | [StyleTreeDelegate](omni.kit.window.inspector.style.style_delegate/omni.kit.window.inspector.style.style_delegate.StyleTreeDelegate.html) | AbstractItemDelegate is used to generate widgets that display and edit data items from a model. |
omni.kit.window.inspector.style.style_delegate.md
# omni.kit.window.inspector.style.style_delegate ## Classes Summary - **StyleTreeDelegate** - AbstractItemDelegate is used to generate widgets that display and edit data items from a model.
omni.kit.window.inspector.style.style_model.Classes.md
# omni.kit.window.inspector.style.style_model Classes ## Classes Summary: - **StyleColorComponentItem** - The object that is associated with the data entity of the AbstractItemModel. - **StyleColorModel** - define a model for a style color, and enable coversion from int32 etc - **StyleComboItemModel** - Model for a combo box - for each setting we have a dictionary of key, values - **StyleComboNameValueItem** - The object that is associated with the data entity of the AbstractItemModel. - **StyleComboValueModel** - Model to store a pair (label, value of arbitrary type) for use in a ComboBox - **StyleGroupItem** - A single AbstractItemModel item that represents a single prim - **StyleItem** - A single AbstractItemModel item that represents a single prim - **StyleModel** - The item model that watches the stage StylePropertyType =============== An enumeration.
omni.kit.window.inspector.style.style_tree.Classes.md
# omni.kit.window.inspector.style.style_tree Classes ## Classes Summary: | Class Name | Description | |------------|-------------| | StyleTreeView | The Stage widget |
omni.kit.window.inspector.style.style_tree.md
# omni.kit.window.inspector.style.style_tree ## Classes Summary: - **StyleTreeView** - The Stage widget
omni.kit.window.inspector.style.Submodules.md
# omni.kit.window.inspector.style Submodules ## Submodules Summary: | Submodule | Docstring | |-----------|-----------| | omni.kit.window.inspector.style.resolved_style | No submodule docstring provided | | omni.kit.window.inspector.style.style_delegate | No submodule docstring provided | | omni.kit.window.inspector.style.style_model | No submodule docstring provided | | omni.kit.window.inspector.style.style_tree | No submodule docstring provided | | omni.kit.window.inspector.style.widget_styles | No submodule docstring provided |
omni.kit.window.inspector.style.widget_styles.md
# omni.kit.window.inspector.style.widget_styles ## omni.kit.window.inspector.style.widget_styles ### omni.kit.window.inspector.style.widget_styles
omni.kit.window.inspector.Submodules.md
# omni.kit.window.inspector Submodules ## Submodules Summary | Submodule | Docstring | |-----------|-----------| | omni.kit.window.inspector.demo_window | No submodule docstring provided | | omni.kit.window.inspector.extension | No submodule docstring provided | | omni.kit.window.inspector.inspector_preview | No submodule docstring provided | | omni.kit.window.inspector.inspector_style | No submodule docstring provided | | omni.kit.window.inspector.inspector_tests | No submodule docstring provided | | omni.kit.window.inspector.inspector_widget | No submodule docstring provided | | omni.kit.window.inspector.inspector_window | No submodule docstring provided | | omni.kit.window.inspector.property | No submodule docstring provided | | omni.kit.window.inspector.style | No submodule docstring provided | | omni.kit.window.inspector.tree | No submodule docstring provided |
omni.kit.window.inspector.tree.inspector_tree.Classes.md
# omni.kit.window.inspector.tree.inspector_tree Classes ## Classes Summary - **InspectorTreeView** - **WindowItem** - The object that is associated with the data entity of the AbstractItemModel. - **WindowListModel** - The central component of the item widget. It is the application’s dynamic data structure, independent of the user interface, and it directly manages the nested data. It follows closely model-view pattern. It’s abstract, and it defines the standard interface to be able to interoperate with the components of the model-view architecture. It is not supposed to be instantiated directly. Instead, the user should subclass it to create a new model.
omni.kit.window.inspector.tree.inspector_tree_delegate.Classes.md
# omni.kit.window.inspector.tree.inspector_tree_delegate Classes ## Classes Summary - **InspectorTreeDelegate** - AbstractItemDelegate is used to generate widgets that display and edit data items from a model.
omni.kit.window.inspector.tree.inspector_tree_model.Classes.md
# omni.kit.window.inspector.tree.inspector_tree_model Classes ## Classes Summary - **InspectorTreeModel** - The item model that watches the stage - **WidgetItem** - A single AbstractItemModel item that represents a single prim
omni.kit.window.inspector.tree.md
# omni.kit.window.inspector.tree ## Submodules Summary | Submodule | Description | |-----------|-------------| | [omni.kit.window.inspector.tree.inspector_tree](omni.kit.window.inspector.tree.inspector_tree.html) | No submodule docstring provided | | [omni.kit.window.inspector.tree.inspector_tree_delegate](omni.kit.window.inspector.tree.inspector_tree_delegate.html) | No submodule docstring provided | | [omni.kit.window.inspector.tree.inspector_tree_model](omni.kit.window.inspector.tree.inspector_tree_model.html) | No submodule docstring provided |
omni.kit.window.popup_dialog.Classes.md
# omni.kit.window.popup_dialog Classes ## Classes Summary - **FormDialog** - A simple popup dialog with a set of input fields and two buttons, OK and Cancel - **FormWidget** - A simple form widget with a set of input fields. As opposed to the dialog class, the widget can be combined - **InputDialog** - A simple popup dialog with an input field and two buttons, OK and Cancel - **InputWidget** - A simple widget with an input field. As opposed to the dialog class, the widget can be combined - **MessageDialog** - This simplest of all popup dialogs displays a confirmation message before executing an action. - **MessageWidget** - This widget displays a custom message. As opposed to the dialog class, the widget can be combined - **OptionsDialog** - A simple checkbox dialog with a set options and two buttons, OK and Cancel - **OptionsMenu** - A simple checkbox menu with a set of options - **OptionsMenuWidget** - A simple checkbox widget with a set of options. As opposed to the menu class, the widget can be combined - **OptionsWidget** - A simple checkbox widget with a set options. As opposed to the dialog class, the widget can be combined | 奇数行 | 内容 | |--------|------| | | PopupDialog | | | Base class for a simple popup dialog with two primary buttons, OK and Cancel. |
omni.kit.window.popup_dialog.FormDialog.md
# FormDialog ## FormDialog ```python class omni.kit.window.popup_dialog.FormDialog: def __init__(self, width=400, parent=None, message=None, title=None, ok_handler=None): pass ``` ``` Bases: - [PopupDialog](omni.kit.window.popup_dialog.PopupDialog.html#omni.kit.window.popup_dialog.PopupDialog) A simple popup dialog with a set of input fields and two buttons, OK and Cancel Keyword Arguments: - **width** (int) – Width of popup window. Default 400. - **parent** (obj:'omni.ui.Widget'): OBSOLETE. - **message** (str) – Message string. - **title** (str) – Title of popup window. Default None. - **ok_handler** (Callable[[AbstractDialog], None]) – - **cancel_handler** (Optional[Callable[[AbstractDialog], None]]) – - **ok_label** (str) – Default 'Ok'. - **cancel_label** (str) – Default 'Cancel'. - **field_defs** (Optional[List[FormDialogFieldDef]]) – - **input_width** (int) – Default 250. - **ok_handler** (Callable[[AbstractDialog], None]) – Handler called when click ok button. Default None. Function signature is: void ok_handler(AbstractDialog) - **cancel_handler** (Callable[[AbstractDialog], None]) – Handler called when click cancel button. Default None. Function signature is: void ok_handler(AbstractDialog) - **ok_label** (str) – Label text for ok button. Default “Ok”. - **cancel_label** (str) – Label text for cancel button. Default “Cancel”. - **field_defs** ([FormDialog.FieldDef]) – List of FieldDefs. Default []. - **input_width** (int) – OBSOLETE. **Note** FormDialog.FieldDef: A namedtuple of (name, label, type, default value) for describing the input field, e.g. FormDialog.FieldDef(“name”, “Name: “, omni.ui.StringField, “Bob”). **Methods** - __init__([width, parent, message, title, ...]) Inherited args from the base class. - destroy() Destructor. - get_field(name) Returns widget corresponding to named field. - get_value(name) Returns value of the named field. - get_values() Returns all values in a dict. - reset_values() Resets all values to their defaults. - show([offset_x, offset_y, parent]) Shows this dialog, optionally offset from the parent widget, if any. **Attributes** : Optional [ Widget ] = None , message : Optional [ str ] = None , title : Optional [ str ] = None , ok_handler : Optional [ Callable [ AbstractDialog , None ] ] = None , cancel_handler : Optional [ Callable [ AbstractDialog , None ] ] = None , ok_label : str = 'Ok' , cancel_label : str = 'Cancel' , field_defs : Inherits args from the base class. ### Keyword Arguments - **width** (`int`) – Window width. Default 400. - **title** (`str`) – Title to display. Default None. - **ok_handler** (`Callable`) – Function to invoke when Ok button clicked. Function signature: `void okay_handler(dialog: PopupDialog)` - **cancel_handler** (`Callable`) – Function to invoke when Cancel button clicked. Function signature: `void cancel_handler(dialog: PopupDialog)` - **ok_label** (`str`) – Alternative text to display on ‘Accept’ button. Default ‘Ok’. - **cancel_label** (`str`) – Alternative text to display on ‘Cancel’ button. Default ‘Cancel’. - **warning_message** (`Optional[str]`) – Warning message that will displayed in red with the warning glyph. Default None. - **parent** (`omni.ui.Widget`) – OBSOLETE. ### FieldDef alias of `FormDialogFieldDef` ### destroy() Destructor. ### get_field(name: str) → AbstractField Returns widget corresponding to named field. #### Parameters - **name** (`str`) – Name of the field. #### Returns - omni.ui.AbstractField ### get_value(name: str) ### get_value Returns value of the named field. #### Parameters - **name** (str) – Name of the field. #### Returns Union[str, int, float, bool] #### Note Doesn’t currently return MultiFields correctly. ### get_values Returns all values in a dict. #### Parameters - **name** (str) – Name of the field. #### Returns dict #### Note Doesn’t currently return MultiFields correctly. ### reset_values Resets all values to their defaults. ### show Shows this dialog, optionally offset from the parent widget, if any. #### Keyword Arguments - **offset_x** (int) – X offset. Default 0. - **offset_y** (int) – Y offset. Default 0. - **parent** (Optional[Widget]) – Parent widget. Default None. ## 参数说明 ### 偏移量 - **x** *(int) – X offset. Default 0.* - **y** *(int) – Y offset. Default 0.* - **parent** *(ui.Widget) – Offset from this parent widget. Default None.*
omni.kit.window.popup_dialog.FormWidget.md
# FormWidget ## FormWidget ```python class omni.kit.window.popup_dialog.FormWidget(message: Optional[str] = None, field_defs: List[FormDialogFieldDef] = []) ``` **Bases:** `object` A simple form widget with a set of input fields. As opposed to the dialog class, the widget can be combined with other widget types in the same window. **Keyword Arguments:** - **message** (`str`) – Message string. - **field_defs** (`[FormDialog.FieldDef]`) – List of FieldDefs. Default `[]`. **Note:** FormDialog.FieldDef: A namedtuple of (name, label, type, default value) for describing the input field, e.g. FormDialog.FieldDef("name", "Name: ", omni.ui.StringField, "Bob"). **Methods:** ``` | Method Name | Description | |-------------|-------------| | `__init__(message, field_defs)` | Initializes the FormWidget with a message and field definitions. | | `destroy()` | Destructor. | | `focus()` | Focus fields for the current widget. | | `get_field(name)` | Returns widget corresponding to named field. | | `get_value(name)` | Returns value of the named field. | | `get_values()` | Returns all values in a dict. | | `reset_values()` | Resets all values to their defaults. | ``` ### __init__(message, field_defs) Initializes the FormWidget with a message and field definitions. - `message`: Optional[str] = None - `field_defs`: List[FormDialogFieldDef] = [] ### destroy() Destructor. ### focus() Focus fields for the current widget. ### get_field(name) Returns widget corresponding to named field. ### get_value(name) Returns value of the named field. ### get_values() Returns all values in a dict. ### reset_values() Resets all values to their defaults. ### FormWidget Methods #### get_field Returns widget corresponding to named field. **Parameters** - **name** (str) – Name of the field. **Returns** - omni.ui.AbstractField #### get_value Returns value of the named field. **Parameters** - **name** (str) – Name of the field. **Returns** - Union[str, int, float, bool] **Note** Doesn’t currently return MultiFields correctly. #### get_values Returns all values in a dict. **Parameters** - **name** (str) – Name of the field. **Returns** - dict **Note** Doesn’t currently return MultiFields correctly. #### reset_values Resets all values to their defaults.