file_path
stringlengths 5
148
| content
stringlengths 150
498k
| size
int64 150
498k
|
---|---|---|
omni.kit.viewport.utility.get_active_viewport_and_window.md | # get_active_viewport_and_window
๏
## Function
```python
omni.kit.viewport.utility.get_active_viewport_and_window(usd_context_name: str = '', wrap_legacy: bool = True, window_name: Optional[str] = None)
```
๏
### Description
Retrieves the active viewport and its window for a given USD context and window name.
### Parameters
- **usd_context_name** (str, optional) โ The name of the USD context to query. If empty, the current USD context is used.
- **wrap_legacy** (bool, optional) โ Flag to determine if a legacy viewport should be wrapped.
- **window_name** (str, optional) โ The name of the window to query. If none is provided, defaults to the viewport window name from settings.
## Returns
A tuple containing the active viewport API instance and the corresponding window instance, or (None, None) if not found.
## Return type
Tuple[Optional[ViewportAPI], Optional[Window]] | 882 |
omni.kit.viewport.utility.get_active_viewport_camera_path.md | # get_active_viewport_camera_path
Retrieves the camera Sdf.Path for the active viewport within a specified USD context.
## Parameters
- **usd_context_name** (str, optional) โ The name of the USD context to query. If empty, the current USD context is used. Defaults to an empty string.
## Returns
- The SDF path to the camera used by the active viewport, or None if no active viewport is found.
## Return type
- Sdf.Path | 426 |
omni.kit.viewport.utility.get_active_viewport_camera_string.md | # get_active_viewport_camera_string
## get_active_viewport_camera_string
Retrieves the camera path string for the active viewport within a specified USD context.
### Parameters
- **usd_context_name** (str, optional) โ The name of the USD context to query. If empty, the current USD context is used. Defaults to an empty string.
### Returns
- The camera path string for the active viewport, or an empty string if no active viewport is found.
### Return type
- str | 466 |
omni.kit.viewport.utility.get_ground_plane_info.md | # get_ground_plane_info
## get_ground_plane_info
Retrieves the ground plane information including its normal and the planes it occupies.
### Parameters
- **viewport** (`ViewportAPI`) โ The viewport API instance for which to get the ground plane information.
- **ortho_special** (`bool`, optional) โ If True, uses an alternate ground plane for orthographic cameras that are looking down a single axis. Defaults to True.
### Returns
A tuple containing the ground plane normal vector and a list of plane axes it occupies (e.g., ['x', 'z']).
### Return type
Tuple[Gf.Vec3d, List[str]] | 584 |
omni.kit.viewport.utility.get_num_viewports.md | # get_num_viewports
๏
## get_num_viewports
Returns the number of active viewports within an optional USD context.
### Parameters
- **usd_context_name** (str, optional) โ The name of the USD context for which to count the viewports. If None, all viewports across all USD contexts are counted. Defaults to None.
### Returns
- The number of active viewports.
### Return type
- int | 380 |
omni.kit.viewport.utility.get_viewport_from_window_name.md | # get_viewport_from_window_name
๏
## get_viewport_from_window_name
Retrieves the first viewport API instance from a specified window name.
If a window name is not provided or is None, it defaults to the viewport window name defined in the settings ('/exts/omni.kit.viewport.window/startup/windowName') or 'Viewport'.
### Parameters
- **window_name** (str, optional) โ The name of the window from which to retrieve the viewport API.
### Returns
- An instance of the viewport API or None if no viewport was found.
### Return type
- Optional[ViewportAPI] | 556 |
omni.kit.viewport.utility.get_viewport_window_camera_path.md | # get_viewport_window_camera_path
๏
## get_viewport_window_camera_path
๏
Retrieves the camera path for the viewport in the specified window.
If the window name is not provided, the default viewport window is used.
### Parameters
- **window_name** (str, optional) โ The name of the window from which to retrieve the camera path.
### Returns
- The SDF path to the camera used by the viewport, or None if the viewport is not found.
### Return type
- Sdf.Path | 460 |
omni.kit.viewport.utility.get_viewport_window_camera_string.md | # get_viewport_window_camera_string
Retrieves the camera path string for the viewport in the specified window.
If the window name is not provided, the default viewport window is used.
## Parameters
- **window_name** (`str`, optional) โ The name of the window from which to retrieve the camera path string.
## Returns
- The camera path string for the viewport, or None if the viewport is not found.
## Return type
- str | 426 |
omni.kit.viewport.utility.post_viewport_message.md | # post_viewport_message
## post_viewport_message
```python
omni.kit.viewport.utility.post_viewport_message(viewport_api_or_window, message: str, message_id: Optional[str] = None)
```
Posts a message as a toast notification to the viewport or viewport window.
### Parameters
- **viewport_api_or_window** โ The viewport API instance or viewport window to which the message will be posted.
- **message** (str) โ The content of the message to post.
- **message_id** (str, optional) โ A unique identifier for the message. Defaults to None. | 537 |
omni.kit.viewport.utility.toggle_global_visibility.md | # toggle_global_visibility
## toggle_global_visibility
```python
omni.kit.viewport.utility.toggle_global_visibility(force_legacy_api: bool = False)
```
Deprecated since version 1.0.15: use omni.kit.viewport.actions.toggle_global_visibility instead.
Toggles the global visibility of all viewport layers.
This function is used to toggle the visibility of all the viewport layers, such as the grid, axis, and stage lights. It can be useful when you want to declutter the viewport or focus on specific elements.
### Parameters
- **force_legacy_api** (bool, optional) โ If True, forces the use of the legacy viewport API. Defaults to False. | 640 |
omni.kit.viewport.window.Classes.md | # omni.kit.viewport.window Classes
## Classes Summary:
| Class | Description |
|-------|-------------|
| ViewportWindow | The Window class represents a window in the underlying windowing system. | | 198 |
omni.kit.viewport.window.Functions.md | # omni.kit.viewport.window Functions
## Functions Summary
| Function | Description |
|----------|-------------|
| get_viewport_window_instances | Get all known ViewportWindow instances, optionally filtering with a UsdContext name. |
| set_viewport_window_default_style | Set the default style for all ViewportWindows, optionally filtering based on the UsdContext the ViewportWindow | | 385 |
omni.kit.viewport.window.get_viewport_window_instances.md | # get_viewport_window_instances
## get_viewport_window_instances
```python
omni.kit.viewport.window.get_viewport_window_instances(usd_context_name: str | None = '')
```
Get all known ViewportWindow instances, optionally filtering with a UsdContext name.
**Parameters**
- **usd_context_name** (str, None) โ An optional argument to limit enumeration to ViewportWindows attached to a specific UsdContext.
**Returns**
- An iterable object for enumerating all found ViewportWindow instances. | 490 |
omni.kit.viewport.window.md | # omni.kit.viewport.window
## Classes Summary
- **ViewportWindow**
- The Window class represents a window in the underlying windowing system.
## Functions Summary
- **get_viewport_window_instances**
- Get all known ViewportWindow instances, optionally filtering with a UsdContext name.
- **set_viewport_window_default_style**
- Set the default style for all ViewportWindows, optionally filtering based on the UsdContext the ViewportWindow | 446 |
omni.kit.viewport.window.set_viewport_window_default_style.md | # set_viewport_window_default_style
## set_viewport_window_default_style
```python
omni.kit.viewport.window.set_viewport_window_default_style(style: dict, overwrite: bool = False, usd_context_name: str | None = '', apply: bool = True)
```
Set the default style for all ViewportWindows, optionally filtering based on the UsdContext the ViewportWindow is attached to.
### Parameters
- **style** (dict) โ An omni.ui style dictionary
- **overwrite** (bool) โ Whether to overwrite any existing style or augment it.
- **usd_context_name** (str, optional) โ The name of the UsdContext. Default is an empty string.
- **apply** (bool, optional) โ Whether to apply the style immediately. Default is True.
## ๆนๆณๅๆฐ่ฏดๆ
### ๅๆฐๅ่กจ
- **viewportWindows** (`None`<em>) โ An optional argument to limit application to ViewportWindows attached to a specific UsdContext.
- **apply** (`bool`<em>) โ Whether to apply the style to existing ViewportWindows, or not. | 941 |
omni.kit.viewport.window.ViewportWindow.md | # ViewportWindow
## ViewportWindow
[int] = None,
style: Optional[dict] = None,
usd_drop_support: bool = True,
hydra_engine_options: Optional[dict] = None,
*ui_args,
**ui_kw_args
)
Bases:
Window
Methods
-------
- __init__(name, usd_context_name, width, ...)
- ViewportWindow constructor
- add_external_drag_drop_support(callback_fn)
- Add a callback for an external drag-drop event onto the ViewportWindow
- destroy()
- Destroy the ViewportWindow instance
- get_frame(name)
- Add a unique `omni.ui.Frame` into the view hierarchy.
- get_instances(usd_context_name)
- remove_external_drag_drop_support()
- Disable external drag-drop into the ViewportWindow
- set_default_style(style, [overwrite, ...])
- set_style(style)
- Set the style of the ViewportWindow
| Style | Description |
|-------|-------------|
| (style) | Set the style for the ViewportWindow |
| The Viewport Window, simple window holding a ViewportLayers widget |
## Attributes
| Attribute | Description |
|-----------|-------------|
| active_window | The Viewport Window, simple window holding a ViewportLayers widget |
| name | Return the name of the ViewportWindow |
| viewport_api | Return the active ViewportAPI for the ViewportWindow |
| viewport_widget | Return the active omni.kit.widget.viewport.ViewportWidget for the ViewportWindow |
| visible | This property holds whether the window is visible. |
## Methods
### `__init__(name: Optional[str] = None, usd_context_name: str = '', width: Optional[int] = None, height: Optional[int] = None, flags: Optional[int] = None)`
- `name`: Optional name, default is None.
- `usd_context_name`: USD context name, default is an empty string.
- `width`: Optional width, default is None.
- `height`: Optional height, default is None.
- `flags`: Optional flags, default is None.
ViewportWindow constructor
Parameters:
- **name** (str) โ The name of the Window.
- **usd_context_name** (str) โ The name of a UsdContext this ViewportWindow will be viewing.
- **width** (int) โ The width of the Window.
- **height** (int) โ The height of the Window.
- **flags** (int) โ omni.ui.WINDOW flags to use for the Window.
- **style** (dict) โ Optional style overrides to apply to the Windowโs frame.
- **usd_drop_support** (bool) โ Enable Usd drop support (requires {py:mod}`omni.kit.window.drop_support`)
- **hydra_engine_options** (dict, None) โ Optional dictionary to use in creation of the HydraEngine
- **\*args** โ Additional arguments to pass to omni.ui.Window
- **\*\*kwargs** โ Additional keyword arguments to pass to omni.ui.Window
add_external_drag_drop_support(callback_fn: Optional[Callable] = None)
Add a callback for an external drag-drop event onto the ViewportWindow
Parameters
==========
- **callback_fn** (`Callable`) โ Object to be invoked when the item is dragged or dropped over the ViewportWindow
destroy
=======
- `destroy()` โ Destroy the ViewportWindow instance
get_frame
=========
- `get_frame(name: str) -> Frame` โ Add a unique {py:class}`omni.ui.Frame` into the view hierarchy. This will return a newly created {py:class}`omni.ui.Frame` on the first call for a unique name, or return a previously created {py:class}`omni.ui.Frame` for the same unique name.
Parameters
----------
- **name** (`str`) โ A unique identifier for the frame.
Returns
-------
- {py:class}`omni.ui.Frame`.
Return type
-----------
- An {py:class}`omni.ui.Frame`.
remove_external_drag_drop_support
================================
- `remove_external_drag_drop_support()` โ Disable external drag-drop into the ViewportWindow
set_style
=========
- `set_style(style)` โ Set the style for the ViewportWindow
Parameters
----------
- **style** โ The omni.ui style object to apply.
active_window
=============
- `active_window: Optional[weakproxy] = None` โ The Viewport Window, simple window holding a ViewportLayers widget
name
====
- `property name` โ Return the name of the ViewportWindow
viewport_api
============
- `property viewport_api` โ Return the active ViewportAPI for the ViewportWindow
viewport_widget
===============
- `property viewport_widget` โ Return the viewport widget for the ViewportWindow
## ViewportWindow Properties
### ViewportWidget
- **Description:** Return the active omni.kit.widget.viewport.ViewportWidget for the ViewportWindow
### visible
- **Type:** property
- **Description:** This property holds whether the window is visible. | 4,402 |
omni.kit.widget.context_menu.add_menu.md | # add_menu
## add_menu
```python
omni.kit.widget.context_menu.add_menu(menu_dict, index: str = 'MENU', extension_id: str = '')
```
Add custom menu to any context_menu
### Examples
```python
menu = {"name": "Open in Material Editor", "onclick_fn": open_material}
# add to all context menus
self._my_custom_menu = omni.kit.context_menu.add_menu(menu, "MENU", "")
# add to omni.kit.widget.stage context menu
self._my_custom_menu = omni.kit.context_menu.add_menu(menu, "MENU", "omni.kit.widget.stage")
```
### Parameters
- **menu_dict** โ a dictionary containing menu settings. See ContextMenuExtension docs for information on values
- **index** โ name of the menu EG. โMENUโ
- **extension_id** โ name of the target EG. โโ or โomni.kit.widget.stageโ
### NOTE
index and extension_id are extension arbitrary values. `add_menu(menu, "MENU", "omni.kit.widget.stage")` works as `omni.kit.widget.stage` retrieves custom context_menus with `get_menu_dict("MENU", "omni.kit.widget.stage")`. Adding a menu to an extension that doesnโt support context_menus would have no effect.
### Returns
- A MenuSubscription, keep a copy of this as the custom menu will be removed when `release()` is explicitly called or this is garbage collected.
- Return type: (MenuSubscription)
# ๆ ้ข
่ฟๆฏไธไธชๆฎต่ฝ๏ผ่ฟ้ๆไธไธช้พๆฅใ
```
```
่ฟๆฏไธๆฎตไปฃ็ ใ | 1,300 |
omni.kit.widget.context_menu.Classes.md | # omni.kit.widget.context_menu Classes
## Classes Summary:
| Class Name | Description |
|------------|-------------|
| ContextMenuEventType | Event sent when menus are added or removed |
| ContextMenuWidgetExtension | Context menu core functionality |
| DefaultMenuDelegate | Icon Menu Delegate class. | | 305 |
omni.kit.widget.context_menu.close_menu.md | # close_menu
๏
## close_menu
๏
### omni.kit.widget.context_menu.close_menu
๏
#### close_menu()
Close currently open context menu. Used by tests not to leave context menu in bad state. | 183 |
omni.kit.widget.context_menu.ContextMenuEventType.md | # ContextMenuEventType
## ContextMenuEventType
Event sent when menus are added or removed
### Methods
### Attributes
| Attribute | Description |
|-----------|-------------|
| `ADDED` | New menu entry is added |
| `REMOVED` | Menu entry is removed |
### `__init__()`
### `ADDED`
New menu entry is added
### `REMOVED`
Menu entry is removed
## ContextMenuEventType.REMOVED
Menu entry is removed | 404 |
omni.kit.widget.context_menu.ContextMenuWidgetExtension.md | # ContextMenuWidgetExtension
## ContextMenuWidgetExtension
- **Bases:** `IExt`
- **Description:** Context menu core functionality
### Methods
- **`__init__()`**
- **Description:** ContextMenuWidgetExtension init function.
- **`close_menu()`**
- **Description:** Close currently open context menu.
- **`get_context_menu()`**
- **Description:** Gets current context_menu.
- **`menu(name[, delegate, glyph, submenu, tearable])`**
- **Description:** Creates a menu.
- **`menu_item(name[, triggered_fn, enabled, ...])`**
- **Description:** Creates a menu item.
- **`on_shutdown()`**
- **Description:**
| Method | Description |
| ------ | ----------- |
| on_shutdown() | ContextMenuWidgetExtension shutdown function. |
| on_startup(ext_id) | ContextMenuWidgetExtension startup function. |
| separator([name]) | Creates a menu separator. |
| show_context_menu(menu_name, objects, menu_list) | Build context menu from menu_list. |
### Attributes
| Attribute | Description |
| --------- | ----------- |
| name | Name of current context menu. |
### Methods
#### __init__()
ContextMenuWidgetExtension init function.
#### close_menu()
Close currently open context menu. Used by tests not to leave context menu in bad state.
#### get_context_menu()
Gets current context_menu.
- Returns: Current context_menu.
- Return type: (str)
#### menu(name: str, delegate=None, glyph='', submenu=False, tearable=False, **kwargs)
Creates a menu.
- Parameters:
- name: str
- delegate: Optional[Any]
- glyph: str
- submenu: bool
- tearable: bool
- kwargs: Additional keyword arguments
- **name** (`str`) โ Name of the menu.
- **delegate** (`ui.MenuDelegate`) โ Specify the delegate to create a custom menu. Optional.
- **glyph** (`str`) โ Path of the glyph image to show before the menu name. Optional.
- **submenu** (`bool`) โ Enables the submenu marker. Optional.
- **tearable** (`bool`) โ The ability to tear the window off. Optional.
**Returns**
- Menu item created.
**Return type**
- `uiMenu`
**menu_item** (`str`, `Optional[Callable]` = None, `bool` = True, `bool` = False, `bool` = False, `bool` = False, `None` = None, `None` = None, `str` = '')
- Creates a menu item.
**Parameters**
- **name** (`str`) โ Name of the menu item.
- **triggered_fn** (`Callable`) โ Function to call when menu item is clicked. Optional.
### Parameters
- **enabled** (`bool`) โ Enable the menu item. Optional.
- **checkable** (`bool`) โ This property holds whether this menu item is checkable. A checkable item is one which has an on/off state. Optional.
- **checked** (`bool`) โ This property holds a flag that specifies the widget has to use eChecked state of the style. Itโs on the Widget level because the button can have sub-widgets that are also should be checked. Optional.
- **is_async_func** (`bool`) โ Optional.
- **delegate** (`ui.MenuDelegate`) โ Specify the delegate to create a custom menu. Optional.
- **additional_kwargs** (`dict`) โ Additional keyword arguments to pass to ui.MenuItem. Optional.
- **glyph** (`str`) โ Path of the glyph image to show before the menu name. Optional.
### Returns
- Menu item created.
### Return type
- `uiMenuItem`
### on_shutdown
- ContextMenuWidgetExtension shutdown function.
### on_startup
- ContextMenuWidgetExtension startup function.
- **Parameters**
- **ext_id** (`str`) โ Extension identifier.
### separator
- Creates a menu separator.
- **Parameters**
- **name** (`str`) โ Name of the menu separator. Optional.
### show_context_menu
- Shows a context menu.
- **Parameters**
- **menu_name** (`str`)
- **objects** (`dict`)
- **menu_list** (`List[dict]`)
### show_context_menu
```python
min_menu_entries: int = 1
delegate: None = None
```
build context menu from menu_list
#### Parameters
- **menu_name** (str) โ menu name
- **objects** (dict) โ context_menu data
- **menu_list** (list) โ list of dictionaries containing context menu values
- **min_menu_entries** (int) โ minimal number of menu needed for menu to be visible
### name
```python
property name: str
```
Name of current context menu.
#### Returns
- Name of current context menu.
#### Return type
- (str)
``` | 4,155 |
omni.kit.widget.context_menu.context_menu.Classes.md | # omni.kit.widget.context_menu.context_menu Classes
## Classes Summary:
| Class | Description |
|-------|-------------|
| [ContextMenuWidgetExtension](omni.kit.widget.context_menu.context_menu/omni.kit.widget.context_menu.context_menu.ContextMenuWidgetExtension.html) | Context menu core functionality |
| [DefaultMenuDelegate](omni.kit.widget.context_menu.context_menu/omni.kit.widget.context_menu.context_menu.DefaultMenuDelegate.html) | Icon Menu Delegate class. | | 469 |
omni.kit.widget.context_menu.context_menu.ContextMenuWidgetExtension.md | # ContextMenuWidgetExtension
## ContextMenuWidgetExtension
```python
class omni.kit.widget.context_menu.context_menu.ContextMenuWidgetExtension
```
Bases: `IExt`
Context menu core functionality
### Methods
- `__init__()`
- ContextMenuWidgetExtension init function.
- `close_menu()`
- Close currently open context menu.
- `get_context_menu()`
- Gets current context_menu.
- `menu(name[, delegate, glyph, submenu, tearable])`
- Creates a menu.
- `menu_item(name[, triggered_fn, enabled, ...])`
-
| Method | Description |
|--------|-------------|
| `on_shutdown()` | ContextMenuWidgetExtension shutdown function. |
| `on_startup(ext_id)` | ContextMenuWidgetExtension startup function. |
| `separator([name])` | Creates a menu separator. |
| `show_context_menu(menu_name, objects, menu_list)` | build context menu from menu_list |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `name` | Name of current context menu. |
### Methods
#### `__init__()`
ContextMenuWidgetExtension init function.
#### `close_menu()`
Close currently open context menu. Used by tests not to leave context menu in bad state.
#### `get_context_menu()`
Gets current context_menu.
- **Returns**: Current context_menu.
- **Return type**: (str)
#### `menu(name: str, delegate=None, glyph='', submenu=False, tearable=False)`
### ContextMenuWidgetExtension.menu
Creates a menu.
#### Parameters
- **name** (str) โ Name of the menu.
- **delegate** (ui.MenuDelegate) โ Specify the delegate to create a custom menu. Optional.
- **glyph** (str) โ Path of the glyph image to show before the menu name. Optional.
- **submenu** (bool) โ Enables the submenu marker. Optional.
- **tearable** (bool) โ The ability to tear the window off. Optional.
#### Returns
- Menu item created.
#### Return type
- (uiMenu)
### ContextMenuWidgetExtension.menu_item
Creates a menu item.
#### Parameters
- **name** (str)
- **triggered_fn** (Optional[Callable]) = None
- **enabled** (bool) = True
- **checkable** (bool) = False
- **checked** (bool) = False
- **is_async_func** = False
- **delegate** = None
- **additional_kwargs** = None
- **glyph** = ''
Parameters
----------
- **name** (`str`) โ Name of the menu item.
- **triggered_fn** (`Callable`) โ Function to call when menu item is clicked. Optional.
- **enabled** (`bool`) โ Enable the menu item. Optional.
- **checkable** (`bool`) โ This property holds whether this menu item is checkable. A checkable item is one which has an on/off state. Optional.
- **checked** (`bool`) โ This property holds a flag that specifies the widget has to use eChecked state of the style. Itโs on the Widget level because the button can have sub-widgets that are also should be checked. Optional.
- **is_async_func** (`bool`) โ Optional.
- **delegate** (`ui.MenuDelegate`) โ Specify the delegate to create a custom menu. Optional.
- **additional_kwargs** (`dict`) โ Additional keyword arguments to pass to ui.MenuItem. Optional.
- **glyph** (`str`) โ Path of the glyph image to show before the menu name. Optional.
Returns
-------
Menu item created.
Return type
------------
(uiMenuItem)
on_shutdown
-----------
ContextMenuWidgetExtension shutdown function.
on_startup
----------
ContextMenuWidgetExtension startup function.
Parameters
----------
- **ext_id** (`str`) โ Extension identifier.
separator
---------
Creates a menu separator.
Parameters
----------
- **name** (`str`) โ Name of the menu separator. Optional.
show_context_menu
-----------------
(Function description not provided in the HTML snippet)
Parameters
----------
- **menu_name** (`str`)
- **objects** (`dict`)
<em class="sig-param">
<span class="n">
<span class="pre">
menu_list
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
List
<span class="p">
<span class="pre">
[
<span class="pre">
dict
<span class="p">
<span class="pre">
]
<em class="sig-param">
<span class="n">
<span class="pre">
min_menu_entries
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
int
<span class="w">
<span class="o">
<span class="pre">
=
<span class="w">
<span class="default_value">
<span class="pre">
1
<em class="sig-param">
<span class="n">
<span class="pre">
delegate
<span class="o">
<span class="pre">
=
<span class="default_value">
<span class="pre">
None
<span class="sig-paren">
)
<span class="sig-return">
<span class="sig-return-icon">
โ
<span class="sig-return-typehint">
<span class="pre">
None
<dd>
<p>
build context menu from menu_list
<dl class="field-list simple">
<dt class="field-odd">
Parameters
<dd class="field-odd">
<ul class="simple">
<li>
<p>
<strong>
menu_name
(
<em>
str
) โ menu name
<li>
<p>
<strong>
objects
(
<em>
dict
) โ context_menu data
<li>
<p>
<strong>
menu_list
(
<em>
list
) โ list of dictionaries containing context menu values
<li>
<p>
<strong>
min_menu_entries
(
<em>
int
) โ minimal number of menu needed for menu to be visible
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.context_menu.context_menu.ContextMenuWidgetExtension.name">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
name
<em class="property">
<span class="p">
<span class="pre">
:
<span class="w">
<span class="pre">
str
<dd>
<p>
Name of current context menu.
<dl class="field-list simple">
<dt class="field-odd">
Returns
<dd class="field-odd">
<p>
Name of current context menu.
<dt class="field-even">
Return type
<dd class="field-even">
<p>
(str)
| 6,212 |
omni.kit.widget.context_menu.context_menu.DefaultMenuDelegate.md | # DefaultMenuDelegate
## DefaultMenuDelegate
```python
class omni.kit.widget.context_menu.context_menu.DefaultMenuDelegate(**kwargs)
```
Bases: `IconMenuBaseDelegate`
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | Constructor. |
### Attributes
| Attribute | Description |
|-----------|-------------|
```
### __init__
```python
def __init__(self, omni.ui._ui.MenuDelegate, **kwargs) -> None
```
Constructor.
```
> ### Keyword Arguments:
>
> - `on_build_item`
> - Called to create a new item.
> - `on_build_title`
> - Called to create a new title.
> - `on_build_status`
> - Called to create a new widget on the bottom of the window.
> - `propagate`
> - Determine if Menu children should use this delegate when they donโt have the own one. | 799 |
omni.kit.widget.context_menu.context_menu.Functions.md | # omni.kit.widget.context_menu.context_menu Functions
## Functions Summary
| Function | Description |
|----------|-------------|
| `close_menu` | Close currently open context menu. Used by tests not to leave context menu in bad state. |
| `get_instance` | Get instance of context menu class |
| `reorder_menu_dict` | Reorder menus using โappear_afterโ value in menu | | 369 |
omni.kit.widget.context_menu.context_menu.md | # omni.kit.widget.context_menu.context_menu
## Classes Summary:
- **ContextMenuWidgetExtension**
Context menu core functionality
- **DefaultMenuDelegate**
Icon Menu Delegate class.
## Functions Summary:
- **close_menu**
Close currently open context menu. Used by tests not to leave context menu in bad state.
- **get_instance**
Get instance of context menu class
- **reorder_menu_dict**
Reorder menus using โappear_afterโ value in menu | 457 |
omni.kit.widget.context_menu.custom_menu_dict.Classes.md | # omni.kit.widget.context_menu.custom_menu_dict Classes
## Classes Summary
- **ContextMenuEventType**
- Event sent when menus are added or removed
- **_CustomMenuDict**
- (No description provided) | 203 |
omni.kit.widget.context_menu.custom_menu_dict.ContextMenuEventType.md | # ContextMenuEventType
## ContextMenuEventType
```python
class omni.kit.widget.context_menu.custom_menu_dict.ContextMenuEventType
```
Event sent when menus are added or removed
### Methods
### Attributes
```python
ADDED = 0
```
New menu entry is added
```python
REMOVED = 1
```
Menu entry is removed
```python
def __init__():
```
```python
ADDED
```
New menu entry is added
```python
REMOVED
```
Menu entry is removed
### REMOVED
= 1
Menu entry is removed | 462 |
omni.kit.widget.context_menu.custom_menu_dict.Functions.md | # omni.kit.widget.context_menu.custom_menu_dict Functions
## Functions Summary
| Function | Description |
|----------|-------------|
| Singleton | A singleton decorator |
| add_menu | Add custom menu to any context_menu |
| get_menu_dict | Get custom menus |
| get_menu_event_stream | Gets menu event stream. |
| merge_menus | Merge custom menus | | 349 |
omni.kit.widget.context_menu.custom_menu_dict.get_menu_dict.md | # get_menu_dict
## get_menu_dict
Get custom menus
see add_menu for dictionary info
### Parameters
- **index** (str) โ name of the menu
- **extension_id** (str) โ name of the target
### Returns
- a list of dictionaries containing custom menu settings. See ContextMenuExtension docs for information on values
### Return type
- (list) | 337 |
omni.kit.widget.context_menu.custom_menu_dict.md | # omni.kit.widget.context_menu.custom_menu_dict
## Classes Summary:
- **ContextMenuEventType**
- Event sent when menus are added or removed
- **_CustomMenuDict**
## Functions Summary:
- **Singleton**
- A singleton decorator
- **add_menu**
- Add custom menu to any context_menu
- **get_menu_dict**
- Get custom menus
- **get_menu_event_stream**
- Gets menu event stream.
- **merge_menus**
- Merge custom menus | 422 |
omni.kit.widget.context_menu.custom_menu_dict.merge_menus.md | # merge_menus
## merge_menus
```python
omni.kit.widget.context_menu.custom_menu_dict.merge_menus(menu_list: list) -> List[dict]
```
Merge custom menus
**Parameters:**
- **menu_list** (list) โ list of dictionaries
**Returns:**
- a list of dictionaries containing custom menu settings. See ContextMenuExtension docs for information on values
**Return type:**
- (list)
``` | 374 |
omni.kit.widget.context_menu.DefaultMenuDelegate.md | # DefaultMenuDelegate
## DefaultMenuDelegate
```python
class omni.kit.widget.context_menu.DefaultMenuDelegate(**kwargs)
```
Bases: `IconMenuBaseDelegate`
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self, **kwargs)` | Constructor. |
### Attributes
| Attribute | Description |
|-----------|-------------|
```
### __init__
```python
def __init__(self, **kwargs) -> None
```
Constructor.
#### Keyword Arguments:
| Argument | Description |
|----------|-------------|
| `on_build_item` | See below |
```
<dl>
<dt>
`on_build_item
<span class="classifier">
`
<dd>
<p>
Called to create a new item.
<dt>
`on_build_title
<span class="classifier">
`
<dd>
<p>
Called to create a new title.
<dt>
`on_build_status
<span class="classifier">
`
<dd>
<p>
Called to create a new widget on the bottom of the window.
<dt>
`propagate
<span class="classifier">
`
<dd>
<p>
Determine if Menu children should use this delegate when they donโt have the own one.
| 1,148 |
omni.kit.widget.context_menu.Functions.md | # omni.kit.widget.context_menu Functions
## Functions Summary
| Function | Description |
|----------|-------------|
| add_menu | Add custom menu to any context_menu |
| close_menu | Close currently open context menu. Used by tests not to leave context menu in bad state. |
| get_instance | Get instance of context menu class |
| get_menu_dict | Get custom menus |
| get_menu_event_stream | Gets menu event stream. |
| merge_menus | Merge custom menus |
| reorder_menu_dict | Reorder menus using โappear_afterโ value in menu | | 527 |
omni.kit.widget.context_menu.get_menu_event_stream.md | # get_menu_event_stream
## get_menu_event_stream
```python
omni.kit.widget.context_menu.get_menu_event_stream()
```
Gets menu event stream.
**Returns:**
Event stream.
**Return type:**
(IEventStream)
``` | 206 |
omni.kit.widget.context_menu.md | # omni.kit.widget.context_menu
## Submodules
Summary:
- **omni.kit.widget.context_menu.context_menu**
- Context menu core functionality
- **omni.kit.widget.context_menu.custom_menu_dict**
- No submodule docstring provided
## Classes
Summary:
- **ContextMenuEventType**
- Event sent when menus are added or removed
- **ContextMenuWidgetExtension**
- Context menu core functionality
- **DefaultMenuDelegate**
- Icon Menu Delegate class.
## Functions
Summary:
- **add_menu**
- Add custom menu to any context_menu
- **close_menu**
- Close currently open context menu. Used by tests not to leave context menu in bad state.
- **get_instance**
- Get instance of context menu class
- **get_menu_dict**
- Get custom menus
- **get_menu_event_stream**
- Get event stream for menu changes
## Table of Contents
### Functions
| Function | Description |
|----------|-------------|
| get_menu_event_stream | Gets menu event stream. |
| merge_menus | Merge custom menus |
| reorder_menu_dict | Reorder menus using โappear_afterโ value in menu | | 1,055 |
omni.kit.widget.context_menu.Submodules.md | # omni.kit.widget.context_menu Submodules
## Submodules Summary:
| Module Name | Description |
|--------------------------------------|----------------------------|
| omni.kit.widget.context_menu.context_menu | Context menu core functionality |
| omni.kit.widget.context_menu.custom_menu_dict | No submodule docstring provided | | 370 |
omni.kit.widget.filebrowser.AbstractColumnDelegate.md | # AbstractColumnDelegate
## AbstractColumnDelegate
An abstract object that is used to put the widget to the file browser asynchronously.
### Methods
- **build_header**()
- Build the header
- **build_widget**(item)
- Build the widget for the given path.
### Attributes
- **initial_width**
- The width of the column
### `__init__`
### `build_header`
Build the header
### AbstractColumnDelegate.build_widget
**Abstract async build_widget(item: ColumnItem)**
Build the widget for the given path. Works inside Frame in async mode. Once the widget is created, it will replace the content of the frame. It allows to await something for a while and create the widget when the result is available.
### AbstractColumnDelegate.initial_width
**Property initial_width**
The width of the column | 796 |
omni.kit.widget.filebrowser.abstract_column_delegate.AbstractColumnDelegate.md | # AbstractColumnDelegate
## AbstractColumnDelegate
An abstract object that is used to put the widget to the file browser asynchronously.
### Methods
| Method | Description |
|--------|-------------|
| `build_header()` | Build the header |
| `build_widget(item)` | Build the widget for the given path. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `initial_width` | The width of the column |
### build_header
Build the header
### build_widget
abstract async build_widget(item: ColumnItem)
Build the widget for the given path. Works inside Frame in async mode. Once the widget is created, it will replace the content of the frame. It allow to await something for a while and create the widget when the result is available.
### initial_width
property initial_width
The width of the column | 822 |
omni.kit.widget.filebrowser.abstract_column_delegate.Classes.md | # omni.kit.widget.filebrowser.abstract_column_delegate Classes
## Classes Summary
- **AbstractColumnDelegate**
- An abstract object that is used to put the widget to the file browser asynchronously.
- [AbstractColumnDelegate Documentation](#)
- **ColumnItem**
- Column Item class to be used with FileBrowserTreeView.
- [ColumnItem Documentation](#) | 359 |
omni.kit.widget.filebrowser.abstract_column_delegate.ColumnItem.md | # ColumnItem
## ColumnItem
```python
class omni.kit.widget.filebrowser.abstract_column_delegate.ColumnItem(path)
```
**Bases:** `object`
Column Item class to be used with FileBrowserTreeView.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(path)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `path` | Path of the item. |
```python
def __init__(path):
```
```python
@property
def path:
```
# Item
## Description
Path of the item. | 498 |
omni.kit.widget.filebrowser.card.Classes.md | # omni.kit.widget.filebrowser.card Classes
## Classes Summary
| Class Name | Description |
|------------|-------------|
| [FileBrowserItemCard](omni.kit.widget.filebrowser.card/omni.kit.widget.filebrowser.card.FileBrowserItemCard.html) | Widget used by FileBrowserGridView to build the browser item. | | 303 |
omni.kit.widget.filebrowser.card.FileBrowserItemCard.md | # FileBrowserItemCard
## FileBrowserItemCard
```
class omni.kit.widget.filebrowser.card.FileBrowserItemCard(item: FileBrowserItem, **kwargs)
```
Bases: `Widget`
Widget used by FileBrowserGridView to build the browser item.
### Parameters
- **item** (`FileBrowserItem`) โ Item to build the widget with.
### Keyword Arguments
- **width** (`int`) โ width of the widget, defaults to 60.
- **height** (`int`) โ height of the widget, defaults to 60.
- **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`)
- **mouse_released_fn** (`Callable`) โ Function called on mouse release. Function signature: void mouse_released_fn(pane: int, button: int, key_mode: int, item: `FileBrowserItem`)
```
### Methods
- `__init__(self, **kwargs)`
- `apply_cut_style()` - Apply cut style to the widget.
- `destroy()` - Destructor
- `draw_badges()` - Draw badges if get_badgets_fn is provided in the constructor.
- `draw_thumbnail(thumbnail)` - Asynchronously redraw thumbnail with the given file.
- `on_drag([thumbnail])` - Default drag handler, create a thumbnail at the given path in the current widget container.
- `refresh_thumbnail_async(thumbnail)` - Asynchronously redraw thumbnail with the given file.
- `remove_cut_style()` - Remove cut style from the widget.
### Attributes
- `item` - Return the item associated with the widget.
```
### Properties
- `mouse_pressed_fn(Callable) โ Function called on mouse release. Function signature: void mouse_pressed_fn(pane: int, button: int, key_mode: int, item: FileBrowserItem)`
- `drop_fn(Callable) โ Function called to handle drag-n-drops. Function signature: void drop_fn(dst_item: FileBrowserItem, event: ui.WidgetMouseDropEvent)`
- `get_thumbnail_fn(Callable) โ Function called to get the thumbnail from the item. Function signature: str badges_provider(item: FileBrowserItem)`
- `get_badges_fn(Callable) โ Function called to get badges from the item. Function signature: List[str] badges_provider(item: FileBrowserItem)`
- `custom_thumbnail(str) โ Thumbnail to override the default one.`
- `drag_fn(Callable) โ Function called to handle dragging thumbnails. Function signature: void drag_fn(thumbnail: str)`
| selected |
|----------|
| Return True when selected. |
__init__(self: omni.ui._ui.Widget, **kwargs) -> None
apply_cut_style()
- Apply cut style to the widget.
destroy()
- Destructor
draw_badges()
- Draw badges if get_badgets_fn is provided in the constructor.
draw_thumbnail(thumbnail: str)
- Asynchronously redraw thumbnail with the given file.
- Parameters
- thumbnail (str) โ thumbnail path.
on_drag(thumbnail: Optional[str] = None)
- Default drag handler, create a thumbnail at the given path in the current widget container.
- Parameters
- thumbnail (str) โ thumbnail path.
- Returns
- The current item path.
refresh_thumbnail_async(thumbnail: str)
- Asynchronously refresh thumbnail.
- Parameters
- thumbnail (str) โ thumbnail path.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.card.FileBrowserItemCard.refresh_thumbnail_async">
<span class="sig-name descname">
<span class="pre">
refresh_thumbnail_async
<span class="sig-paren">
(
<span class="sig-paren">
)
<a class="headerlink" href="#omni.kit.widget.filebrowser.card.FileBrowserItemCard.refresh_thumbnail_async" title="Permalink to this definition">
๏
<dd>
<p>
Asynchronously redraw thumbnail with the given file.
<dl class="field-list simple">
<dt class="field-odd">
Parameters
<dd class="field-odd">
<p>
<strong>
thumbnail
(
<em>
str
) โ thumbnail path.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.card.FileBrowserItemCard.remove_cut_style">
<span class="sig-name descname">
<span class="pre">
remove_cut_style
<span class="sig-paren">
(
<span class="sig-paren">
)
<a class="headerlink" href="#omni.kit.widget.filebrowser.card.FileBrowserItemCard.remove_cut_style" title="Permalink to this definition">
๏
<dd>
<p>
Remove cut style from the widget.
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.card.FileBrowserItemCard.item">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
item
<em class="property">
<span class="p">
<span class="pre">
:
<span class="w">
<span class="pre">
FileBrowserItem
<dd>
<p>
Return the item associated with the widget.
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.card.FileBrowserItemCard.selected">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
selected
<em class="property">
<span class="p">
<span class="pre">
:
<span class="w">
<span class="pre">
bool
<dd>
<p>
Return True when selected.
| 5,844 |
omni.kit.widget.filebrowser.Classes.md | # omni.kit.widget.filebrowser Classes
## Classes Summary
| Class Name | Description |
|------------|-------------|
| [AbstractColumnDelegate](omni.kit.widget.filebrowser/omni.kit.widget.filebrowser.AbstractColumnDelegate.html) | An abstract object that is used to put the widget to the file browser asynchronously. |
| [ColumnItem](omni.kit.widget.filebrowser/omni.kit.widget.filebrowser.ColumnItem.html) | Column Item class to be used with FileBrowserTreeView. |
| [FileBrowserItem](omni.kit.widget.filebrowser/omni.kit.widget.filebrowser.FileBrowserItem.html) | Base class for the Filebrowser view Item. |
| [FileBrowserItemCard](omni.kit.widget.filebrowser/omni.kit.widget.filebrowser.FileBrowserItemCard.html) | Widget used by FileBrowserGridView to build the browser item. |
| [FileBrowserItemFactory](omni.kit.widget.filebrowser/omni.kit.widget.filebrowser.FileBrowserItemFactory.html) | Factory to create :obj:`FileBrowserItem` instances. |
| [FileBrowserModel](omni.kit.widget.filebrowser/omni.kit.widget.filebrowser.FileBrowserModel.html) | Base class for the Filebrowser view Model. |
| [FileBrowserUdimItem](omni.kit.widget.filebrowser/omni.kit.widget.filebrowser.FileBrowserUdimItem.html) | A Filebrowser UDIM item class for navigating a the local filesystem in a Filebrowser view. |
| [FileBrowserWidget](omni.kit.widget.filebrowser/omni.kit.widget.filebrowser.FileBrowserWidget.html) | The basic UI widget for navigating a filesystem as a tree or grid view. |
| [FileSystemItem](omni.kit.widget.filebrowser/omni.kit.widget.filebrowser.FileSystemItem.html) | A Filebrowser item class for navigating a the local filesystem in a Filebrowser view. |
| [FileSystemModel](omni.kit.widget.filebrowser/omni.kit.widget.filebrowser.FileSystemModel.html) | A Filebrowser model class for navigating a the local filesystem in a Filebrowser view. |
| NucleusConnectionItem | NucleusItem that represents a nucleus connection. |
| --- | --- |
| NucleusItem | A Filebrowser item class for navigating a Nucleus server in a Filebrowser view. |
| NucleusModel | A Filebrowser model class for navigating a Nucleus server in a Filebrowser view. |
| ColumnDelegateRegistry | | | 2,170 |
omni.kit.widget.filebrowser.clipboard.Classes.md | # omni.kit.widget.filebrowser.clipboard Classes
## Classes Summary:
| Class Name | Description |
|------------|-------------|
| [FileBrowserItem](omni.kit.widget.filebrowser.clipboard/omni.kit.widget.filebrowser.clipboard.FileBrowserItem.html) | Base class for the Filebrowser view Item. | | 291 |
omni.kit.widget.filebrowser.clipboard.FileBrowserItem.md | # FileBrowserItem
## FileBrowserItem
```python
class omni.kit.widget.filebrowser.clipboard.FileBrowserItem(path: str, fields: FileBrowserItemFields, is_folder: bool = False, is_deleted: bool = False)
```
Bases: `AbstractItem`
Base class for the Filebrowser view Item.
Should be sub-classed to implement specific filesystem behavior. The Constructor should not be
called directly. Instead there are factory methods available for creating instances when needed.
### Parameters
- **path** (str) โ Path of the item.
- **fields** (FileBrowserItemFields) โ Fields of the item.
- **is_folder** (`bool`) โ Set to True if the item is a folder.
- **is_deleted** (`bool`) โ Set to True if the item is deleted.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self)` | |
| `add_child(item)` | Add item as child. |
| `datetime_as_string(value)` | Convert datatime to string. |
| `del_child(item_name)` | Delete child item by name. |
| `get_custom_thumbnails_for_folder_async()` | Return the thumbnail dictionary for this (folder) item. |
| `get_subitem_model(index)` | Return ith column of this item. |
| `has_mouse_pressed_fn()` | Check if the item has a mouse pressed callback assigned. |
| `mouse_pressed_fn()` | Mouse pressed callback. |
| `on_list_change_event(event, entry)` | Virtual method to be implemented by sub-class. |
| `on_populated_async([result, children, callback])` | async callback after finish populating the item. |
| `populate_async([callback_async, timeout])` | Populate current item asynchronously if not already. |
| `populate_with_callback(callback[, timeout])` | Populate this item if not already populated. |
| `size_as_string()` | |
| Attributes | Description |
| --- | --- |
| alert | Get/set alert level and message. |
| children | Children of this item. |
| context_menu | Optionally provide a context menu to be shown when this item is right-clicked. |
| enable_sorting | True if item's children are sortable. |
| expandable | whether this FileBrowserItem is expandable. |
| fields | A subset of the item's stats stored as a string tuple. |
| hideable | whether this FileBrowserItem is hideable. |
| icon | Get/set path to icon file. |
| is_deleted | True if this item is a deleted folder/file. |
| is_folder | True if this item is a folder. |
| is_udim_file | Get/Set item udim_file state. |
| item_changed | True if this item is has been restore/delete already. |
| models | The columns of this item. |
| name | Item name. |
<p>
Parent of this item.
<p>
Full path name.
<p>
Get/Set item populated state.
<p>
True if the item is readable.
<p>
True if the item is writeable.
<dl>
<dt>
<span class="pre">
__init__
(
<em>
<span class="pre">
self
:
<span class="pre">
omni.ui._ui.AbstractItem
)
<span class="sig-return">
โ
<span class="pre">
None
<dl>
<dt>
<span class="pre">
add_child
(
<em>
<span class="pre">
item
:
<span class="pre">
object
)
<dd>
<p>
Add item as child.
<dl>
<dt>
Parameters
<dd>
<p>
<strong>
item
(
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
FileBrowserItem
) โ Child item.
<dl>
<dt>
<em>
<span class="pre">
static
<span class="pre">
datetime_as_string
(
<em>
<span class="pre">
value
:
<span class="pre">
datetime
)
<span class="sig-return">
โ
<span class="pre">
str
<dd>
<p>
Convert datatime to string.
<dl>
<dt>
<span class="pre">
del_child
(
<em>
<span class="pre">
item_name
:
<span class="pre">
str
)
<dd>
<p>
Delete child item by name.
(str) โ Name of child item.
### get_custom_thumbnails_for_folder_async
Return the thumbnail dictionary for this (folder) item.
#### Returns
With children urlโs as keys, and urlโs to thumbnail files as values.
#### Return type
Dict
### get_subitem_model
Return ith column of this item.
#### Returns
AbstractValueModel
### has_mouse_pressed_fn
Check if the item has a mouse pressed callback assigned.
### mouse_pressed_fn
Mouse pressed callback.
### on_list_change_event
Virtual method to be implemented by sub-class. When called with a ListEvent, should update this itemโs children list with the corresponding ListEntry.
#### Parameters
- event (omni.client.ListEvent) โ One of of {UNKNOWN, CREATED, UPDATED, DELETED, METADATA, LOCKED, UNLOCKED}.
- entry (omni.client.ListEntry) โ Updated entry as defined by omni.client.
### omni.kit.widget.filebrowser.clipboard.FileBrowserItem.on_populated_async
async def on_populated_async(
self,
result: Optional[Any] = None,
children: Optional[Dict[str, Optional[Dict[str, FileBrowserItem]]]] = None,
callback: Optional[Callable[[Dict[str, FileBrowserItem], None], None]] = None
):
# async callback after finish populating the item.
#### Parameters
- **result** (Any) โ result from populate async.
- **children** (Dict[str, FileBrowserItem]) โ dictionary of children items to pass to the callback.
- **callback** (Callable) โ function to call. Function signature: callback(result: Any, children: Dict[str, FileBrowserItem]) -> None
### omni.kit.widget.filebrowser.clipboard.FileBrowserItem.populate_async
async def populate_async(
self,
callback_async: Optional[Callable] = None,
timeout: float = None
):
# async method to populate the item
### populate_async
Populate current item asynchronously if not already. Override this method to customize for specific file systems.
#### Parameters
- **callback_async** (`Callable`) โ Function signature is void callback(result, children: Dict[str, FileBrowserItem]), where result is an Exception type upon error.
- **timeout** (`float`) โ Time out duration on failed server connections. Default 10.0.
#### Returns
Result of executing callback.
#### Return type
Any
### populate_with_callback
Populate this item if not already populated. When done, executes callback.
#### Parameters
- **callback** (`Callable`) โ Function signature is void callback(children: [FileBrowserItem]).
- **timeout** (`float`) โ Time out duration on failed server connections. Default 10.0.
### size_as_string
Convert data size in bytes to a human readable string.
### alert
Get/set alert level and message.
### children
Get/set children.
Children of this item. Does not populate the item if not already populated.
Type
----
dict[FileBrowserItem]
Optionally provide a context menu to be show when this item is right-clicked.
True if itemโs children are sortable.
Type
----
bool
whether this FileBrowserItem is expandable. Override to change behavior
A subset of the itemโs stats stored as a string tuple.
Type
----
FileBrowserItemFields
whether this FileBrowserItem is hideable. Override to change behavior
Get/set path to icon file.
Type
----
str
### is_deleted
**Type:** bool
True if this item is a deleted folder/file.
### is_folder
**Type:** bool
True if this item is a folder.
### is_udim_file
**Type:** bool
Get/Set item udim_file state.
### item_changed
**Type:** bool
True if this item is has been restore/delete already.
### models
**Type:** Tuple[ui.AbstractValueModel]
The columns of this item.
### name
**Type:** str
Item name.
### parent
**Type:** object
Parent of this item.
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.clipboard.FileBrowserItem.path">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
path
<em class="property">
<span class="p">
<span class="pre">
:
<span class="w">
<span class="pre">
str
<dd>
<p>
Full path name.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
str
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.clipboard.FileBrowserItem.populated">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
populated
<em class="property">
<span class="p">
<span class="pre">
:
<span class="w">
<span class="pre">
bool
<dd>
<p>
Get/Set item populated state.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
bool
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.clipboard.FileBrowserItem.readable">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
readable
<em class="property">
<span class="p">
<span class="pre">
:
<span class="w">
<span class="pre">
bool
<dd>
<p>
True if the item is readable.
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.clipboard.FileBrowserItem.writeable">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
writeable
<em class="property">
<span class="p">
<span class="pre">
:
<span class="w">
<span class="pre">
bool
<dd>
<p>
True if the item is writeable.
| 9,725 |
omni.kit.widget.filebrowser.clipboard.Functions.md | # omni.kit.widget.filebrowser.clipboard Functions
## Functions Summary
| Function Name | Description |
|---------------|-------------|
| clear_clipboard | Clear the clipboard. |
| get_clipboard_items | Get browser items. |
| is_clipboard_cut | Return True if items in the clipboard are cut from other items. |
| is_path_cut | Return True if the path are cut from other items or clipboard. |
| save_items_to_clipboard | Save browser items to clipboard. | | 455 |
omni.kit.widget.filebrowser.clipboard.get_clipboard_items.md | # get_clipboard_items
## get_clipboard_items
```python
omni.kit.widget.filebrowser.clipboard.get_clipboard_items()
```
โ List[FileBrowserItem]
Get browser items.
``` | 167 |
omni.kit.widget.filebrowser.clipboard.is_clipboard_cut.md | # is_clipboard_cut
## is_clipboard_cut
```python
omni.kit.widget.filebrowser.clipboard.is_clipboard_cut() -> bool
```
Return True if items in the clipboard are cut from other items.
```
``` | 190 |
omni.kit.widget.filebrowser.clipboard.is_path_cut.md | # is_path_cut
## is_path_cut
```python
omni.kit.widget.filebrowser.clipboard.is_path_cut(path: str) -> bool
```
Return True if the path are cut from other items or clipboard.
**Parameters**
- **path** (str) โ path to check.
``` | 229 |
omni.kit.widget.filebrowser.clipboard.md | # omni.kit.widget.filebrowser.clipboard
## Classes Summary
- **FileBrowserItem**
- Base class for the Filebrowser view Item.
## Functions Summary
- **clear_clipboard**
- Clear the clipboard.
- **get_clipboard_items**
- Get browser items.
- **is_clipboard_cut**
- Return True if items in the clipboard are cut from other items.
- **is_path_cut**
- Return True if the path are cut from other items or clipboard.
- **save_items_to_clipboard**
- Save browser items to clipboard. | 490 |
omni.kit.widget.filebrowser.clipboard.save_items_to_clipboard.md | # save_items_to_clipboard
## save_items_to_clipboard
```python
omni.kit.widget.filebrowser.clipboard.save_items_to_clipboard(items: List[FileBrowserItem], is_cut: bool = False)
```
Save browser items to clipboard.
### Parameters
- **items** (List[FileBrowserItem]) โ List of browser items.
- **is_cut** (bool) โ Specify if items are cut from other items or clipboard, defaults to False.
``` | 393 |
omni.kit.widget.filebrowser.ColumnItem.md | # ColumnItem
## ColumnItem
```python
class omni.kit.widget.filebrowser.ColumnItem(path)
```
Bases: `object`
Column Item class to be used with FileBrowserTreeView.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(path)` | |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `path` | Path of the item. |
#### `__init__(path)`
#### `path`
Path of the item.
``` | 414 |
omni.kit.widget.filebrowser.date_format_menu.Classes.md | # omni.kit.widget.filebrowser.date_format_menu Classes
## Classes Summary
| Class Name | Description |
|------------|-------------|
| [DatetimeFormatMenu](omni.kit.widget.filebrowser.date_format_menu/omni.kit.widget.filebrowser.date_format_menu.DatetimeFormatMenu.html) | Menu to set datetime format. | | 304 |
omni.kit.widget.filebrowser.date_format_menu.DatetimeFormatMenu.md | # DatetimeFormatMenu
## DatetimeFormatMenu
### Class: omni.kit.widget.filebrowser.date_format_menu.DatetimeFormatMenu
#### Parameters
- **value_changed_fn** (*Callable*): function to call when datetime format changed. Function Signature: void value_changed_fn()
#### Methods
- **__init__** ([value_changed_fn])
- **destroy**
| Method | Description |
|--------|-------------|
| `destroy()` | Destructor |
| `show_at(x: float, y: float)` | Show the menu at the given position. |
## Attributes
| Attribute | Description |
|-----------|-------------|
| `visible` | Return True if the menu is visible. |
## Methods
### `__init__(value_changed_fn: Optional[Callable[[], None]] = None)`
### `destroy()`
Destructor
### `show_at(x: float, y: float)`
Show the menu at the given position.
### `visible`
Return True if the menu is visible. | 838 |
omni.kit.widget.filebrowser.FileBrowserItemCard.md | # FileBrowserItemCard
## FileBrowserItemCard
```
class omni.kit.widget.filebrowser.FileBrowserItemCard(item: FileBrowserItem, **kwargs)
```
Bases: `Widget`
Widget used by FileBrowserGridView to build the browser item.
### Parameters
- **item** (`FileBrowserItem`) โ Item to build the widget with.
### Keyword Arguments
- **width** (int) โ width of the widget, defaults to 60.
- **height** (int) โ height of the widget, defaults to 60.
- **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)
```
### Methods
- `__init__(self, **kwargs)`
- `apply_cut_style()` - Apply cut style to the widget.
- `destroy()` - Destructor
- `draw_badges()` - Draw badges if get_badgets_fn is provided in the constructor.
- `draw_thumbnail(thumbnail)` - Asynchronously redraw thumbnail with the given file.
- `on_drag([thumbnail])` - Default drag handler, create a thumbnail at the given path in the current widget container.
- `refresh_thumbnail_async(thumbnail)` - Asynchronously redraw thumbnail with the given file.
- `remove_cut_style()` - Remove cut style from the widget.
### Attributes
| item | Return the item associated with the widget. |
| --- | --- |
| selected | Return True when selected. |
### __init__(self: omni.ui._ui.Widget, **kwargs) -> None
- Initialize the widget.
### apply_cut_style()
- Apply cut style to the widget.
### destroy()
- Destructor
### draw_badges()
- Draw badges if get_badgets_fn is provided in the constructor.
### draw_thumbnail(thumbnail: str)
- Asynchronously redraw thumbnail with the given file.
- **Parameters**
- **thumbnail** (str) โ thumbnail path.
### on_drag(thumbnail: Optional[str] = None)
- Default drag handler, create a thumbnail at the given path in the current widget container.
- **Parameters**
- **thumbnail** (str) โ thumbnail path.
- **Returns**
- The current item path.
## Methods
### refresh_thumbnail_async
```python
async refresh_thumbnail_async(thumbnail: str)
```
Asynchronously redraw thumbnail with the given file.
**Parameters**
- **thumbnail** (`str`) โ thumbnail path.
### remove_cut_style
```python
remove_cut_style()
```
Remove cut style from the widget.
## Properties
### item
```python
property item: FileBrowserItem
```
Return the item associated with the widget.
### selected
```python
property selected: bool
```
Return True when selected. | 2,649 |
omni.kit.widget.filebrowser.FileBrowserItemFactory.md | # FileBrowserItemFactory
Factory to create [FileBrowserItem](omni.kit.widget.filebrowser.FileBrowserItem.html#omni.kit.widget.filebrowser.FileBrowserItem) instances.
## Methods
| Method | Description |
|---------------------------------|--------------------------------------|
| `create_dummy_item(name, path)` | Create a dummy item at the given path. |
| `create_group_item(name, path)` | Create a folder item at the given path. |
| `create_udim_item(name, path, range_start, ...)` | Create a UDIM item. |
### create_dummy_item
**Parameters**
- **name** (str) โ name of the item.
- **path** (str) โ path of the item.
Create a dummy item at the given path.
### create_group_item
**Parameters**
- **name** (str) โ name of the item.
- **path** (str) โ path of the item.
Create a folder item at the given path.
### create_udim_item
**Parameters**
- **name** (str) โ name of the item.
- **path** (str) โ path of the item.
- **range_start** (int) โ
- **range_end** (int) โ
- **repr_frame** (int) โ
Create a UDIM item.
- **name** (`str`) โ name of the item.
- **path** (`str`) โ path of the item.
- **range_start** (`int`) โ Starting index of UDIM sequence.
- **range_end** (`int`) โ End index of UDIM sequence.
- **repr_frame** (`int`) โ Index in UDIM sequence. | 1,317 |
omni.kit.widget.filebrowser.FileBrowserModel.md | # FileBrowserModel
## FileBrowserModel
```python
class omni.kit.widget.filebrowser.FileBrowserModel(name: Optional[str] = None, root_path: str = '', **kwargs)
```
**Bases:** `AbstractItemModel`
**Description:**
Base class for the Filebrowser view Model. Should be sub-classed to implement specific filesystem behavior.
**Parameters:**
- `name` (str): Name of root item. If None given, then create an initially empty model.
**Keyword Arguments:**
- `drop_fn` (Callable): Function called to handle drag-n-drops. Function signature: `void drop_fn(dst_item: FileBrowserItem, src_item: FileBrowserItem)`
- `filter_fn` (Callable): This handler should return True if the given Filebrowser view item is visible, False otherwise. Function signature: `bool filter_fn(item: FileBrowserItem)`
```
### Attributes
- **FileBrowserItem**
- **sort_by_field** (str) โ Name of column by which to sort items in the same folder. Default โnameโ.
- **sort_ascending** (bool) โ Sort in ascending order. Default True.
- **timeout** (float) โ Timeout when updating item asynchronously.
### Methods
- **__init__**(self) - Constructs AbstractItemModel.
- **auto_refresh_item**(item[,ย throttle_frames]) - Watch the given folder and updates the children list as soon as its contents are changed.
- **copy_presets**(model) - Reset our fields to default arguments from the given model.
- **destroy**() - Destructor.
- **drop**(dst_item,ย source) - Invoke user-supplied function to handle dropping source onto destination item.
- **drop_accepted**(dst_item,ย src_item) - Reimplemented from AbstractItemModel.
- **filter_items**(items) - Return the items filtered with the filter function set.
- **get_drag_mime_data**(item) - Return Multipurpose Internet Mail Extensions (MIME) data for be able to drop this item somewhere.
- **get_item_children**(item) - Return the list of items that are nested to the given parent item.
- **get_item_value_model**(item,ย index) - Get the value model associated with this item.
- **get_item_value_model_count**(item) - Return the number of columns this model item contains.
- **on_list_change_event**(item,ย result,ย event,ย entry) -
Process change events for the given folder.
Set the handler that would return True if the given Filebrowser view item is visible, False otherwise.
Scan given folder for missed changes; processes any changes found.
Attributes
------------
builtin_column_count
--------------------
Return the number of available columns without tag delegates
drag_mime_data
--------------
Return the string with the drag and drop payload.
root
----
Get/set the root item of this model.
show_udim_sequence
-------------------
Show the UDIM sequence.
single_column
-------------
The panel on the left side works in one-column mode
sort_ascending
--------------
Get/set the sort ascending state.
sort_by_field
-------------
Get/set the sort-by field name.
__init__
--------
Constructs AbstractItemModel.
### Keyword Arguments:
- `kwargs dict`: See below
auto_refresh_item
------------------
(item: FileBrowserItem, throttle_frames)
### auto_refresh_item
Watch the given folder and updates the children list as soon as its contents are changed.
#### Parameters
- **item** (`FileBrowserItem`) โ The folder item to watch.
- **throttle_frames** โ Number of frames to throttle the UI refresh.
### copy_presets
Reset our fields to default arguments from the given model.
### destroy
Destructor.
### drop
Invoke user-supplied function to handle dropping source onto destination item.
#### Parameters
- **dst_item** (`FileBrowserItem`) โ Target item.
- **src_item** (`FileBrowserItem`) โ Source item.
### FileBrowserModel.drop_accepted
```python
drop_accepted(dst_item: FileBrowserItem, src_item: FileBrowserItem) -> bool
```
Reimplemented from AbstractItemModel. Called to highlight target when drag and drop. Returns True if destination item is able to accept a drop. This function can be overriden to implement a different behavior.
#### Parameters
- **dst_item** (FileBrowserItem) โ Target item.
- **src_item** (FileBrowserItem) โ Source item.
#### Returns
- bool
### FileBrowserModel.filter_items
```python
filter_items(items: List[FileBrowserItem]) -> List[FileBrowserItem]
```
Return the items filtered with the filter function set.
### FileBrowserModel.get_drag_mime_data
```python
get_drag_mime_data(item: FileBrowserItem)
```
Return Multipurpose Internet Mail Extensions (MIME) data for be able to drop this item somewhere.
### FileBrowserModel.get_item_children
```python
get_item_children(item: FileBrowserItem) -> List[FileBrowserItem]
### get_item_children
Return the list of items that are nested to the given parent item.
**Parameters**
- **item** (`FileBrowserItem`) โ Parent item.
**Returns**
- list[`FileBrowserItem`]
### get_item_value_model
Get the value model associated with this item.
**Parameters**
- **item** (`FileBrowserItem`) โ The item in question.
**Returns**
- `AbstractValueModel`
### get_item_value_model_count
Return the number of columns this model item contains.
**Parameters**
- **item** (`FileBrowserItem`) โ The item in question.
**Returns**
- int
### on_list_change_event
(Method description not provided)
**Parameters**
- **item** (`FileBrowserItem`) โ The item in question.
- **result** (`Result`) โ (Description not provided)
Process change events for the given folder.
Parameters
----------
- **item** (`FileBrowserItem`) โ The folder item.
- **result** (`omni.client.Result`) โ Set by omni.client upon listing the folder.
- **event** (`omni.client.ListEvent`) โ Event type.
- **throttle_frames** โ Number of frames to throttle the UI refresh.
Set the handler that would return True if the given Filebrowser view item is visible, False otherwise. Function signature: bool filter_fn(item: `FileBrowserItem`)
Scan given folder for missed changes; processes any changes found.
Parameters
----------
- **item** (`FileBrowserItem`) โ The folder item to watch.
Return the number of available columns without tag delegates
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.FileBrowserModel.drag_mime_data">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
drag_mime_data
<a class="headerlink" href="#omni.kit.widget.filebrowser.FileBrowserModel.drag_mime_data" title="Permalink to this definition">
๏
<dd>
<p>
Return the string with the drag and drop payload.
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.FileBrowserModel.root">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
root
<em class="property">
<span class="p">
<span class="pre">
:
<span class="w">
<span class="pre">
FileBrowserItem
<dd>
<p>
Get/set the root item of this model.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
FileBrowserItem
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.FileBrowserModel.show_udim_sequence">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
show_udim_sequence
<dd>
<p>
Show the UDIM sequence.
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.FileBrowserModel.single_column">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
single_column
<dd>
<p>
The panel on the left side works in one-column mode
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.FileBrowserModel.sort_ascending">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
sort_ascending
<em class="property">
<span class="p">
<span class="pre">
:
<span class="w">
<span class="pre">
bool
<dd>
<p>
Get/set the sort ascending state.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
FileBrowserItem
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.FileBrowserModel.sort_by_field">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
sort_by_field
<em class="property">
<span class="p">
<span class="pre">
:
<span class="w">
<span class="pre">
str
<dd>
<p>
Get/set the sort-by field name.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
FileBrowserItem
| 9,440 |
omni.kit.widget.filebrowser.FileBrowserUdimItem.md | # FileBrowserUdimItem
## FileBrowserUdimItem
```python
class omni.kit.widget.filebrowser.FileBrowserUdimItem(path: str, fields: FileBrowserItemFields, range_start: int, range_end: int, repr_frame: Optional[int] = None)
```
Bases: `FileBrowserItem`
A Filebrowser UDIM item class for navigating a the local filesystem in a Filebrowser view. Sub-classed from `FileBrowserItem`.
### Parameters
- **path** (`str`): The path to the file or directory.
- **fields** (`FileBrowserItemFields`): The fields associated with the item.
- **range_start** (`int`): The start range of the item.
- **range_end** (`int`): The end range of the item.
- **repr_frame** (`Optional[int]`): The representation frame, default is `None`.
```
### Parameters
- **path** (`str`) โ path of the item.
- **fields** (`FileBrowserItemFields`) โ Fields of the item.
- **is_folder** (`bool`) โ Specify the item as a folder.
- **range_start** (`int`) โ Starting index of UDIM sequence.
- **range_end** (`int`) โ End index of UDIM sequence.
- **repr_frame** (`int`) โ Index in UDIM sequence.
### Methods
- `__init__(self)`
- `get_udim_sequence(full_path: str)` - Get the UDIM sequence by path.
- `populate_udim(parent: FileBrowserItem)` - Generate UDIM items under the given item.
### Attributes
- `repr_path` - Full thumbnail path name.
### `__init__(self: omni.ui._ui.AbstractItem) -> None`
### `get_udim_sequence(full_path: str)`
Get the UDIM sequence by path.
### `populate_udim(parent: FileBrowserItem)`
Generate UDIM items under the given item.
## repr_path
Full thumbnail path name.
### Type
- str | 1,576 |
omni.kit.widget.filebrowser.FileBrowserWidget.md | # FileBrowserWidget
## Overview
The basic UI widget for navigating a filesystem as a tree or grid view. The filesystem can either be from your local machine or the Omniverse Nucleus server.
### 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.
- **tooltip** (bool) โ Display tooltips when hovering over items. Default False.
- **allow_multi_selection** (bool) โ Allow multiple items to be selected at once. Default True.
- **mouse_pressed_fn** (Callable) โ Function called on mouse press. Function signature: void mouse_pressed_fn(pane: int, button: int, key_mode: int, item: FileBrowserItem, x: float=0, y: float=0)
- **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)
### Parameters
- **FileBrowserItem** (title, x: float=0, y: float=0)
- **selection_changed_fn** (Callable) โ Function called when selection changed. Function signature: void selection_changed_fn(pane: int, selections: list[FileBrowserItem])
- **drop_fn** (Callable) โ Function called to handle drag-n-drops. Function signature: void drop_fn(dst_item: FileBrowserItem, src_path: str)
- **filter_fn** (Callable) โ This user function should return True if the given tree view item is visible, False otherwise. Function signature: bool filter_fn(item: FileBrowserItem)
- **show_grid_view** (bool) โ If True, initialize the folder view to display icons. Default False.
- **show_recycle_widget** (bool) โ If True, show recycle view in the left bottom corner. Default False.
- **grid_view_scale** (int) โ 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.
- **icon_provider** (Callable) โ This callback provides an icon to replace the default one in the tree view. Signature: str icon_provider(item: FileBrowserItem, expanded: bool).
- **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).
- **badges_provider** (Callable) โ This callback provides the list of badges to layer atop the thumbnail in the grid view. Callback signature: List[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_model_as_subtree** (model[, parent]) โ Add a new model as the subtree of the tree view root model or the given parent item.
- **clear_item_alert** (item) โ Clear the alert of the given item.
create_grouping_item (name, path[, parent])
Create a folder item at the given path and add it as child to the tree view root model or the given parent item.
delete_child (item[, parent])
Delete an item from the tree view root model or the given parent item.
delete_child_by_name (item_name[, parent])
Delete an item from the tree view root model or the given parent item.
destroy ()
Destructor.
get_root ([pane])
Get the root item of the treeview by pane.
get_selected_item ([pane])
Return last of selected item from the specified pane.
get_selections ([pane])
Return list of selected items from the specified pane.
hide_notification ()
Hide the notification frame.
link_views (src_widget)
Link this widget to the given widget, i.e. the 2 widgets will therafter display the same models but not necessarily share the same view.
refresh_ui ([item, listview_only])
Redraw the subtree rooted at the given item.
scale_grid_view (scale)
Set the scale of item inside grid view.
select_and_center (selection[, pane])
Select and centers the tree view on the given item, expanding the tree if needed.
set_expanded (item, expanded[, recursive])
Set the expansion state of the given item.
set_item_alert (item, alert_level, msg)
Set the alert message of the given item.
| Method | Description |
| ------ | ----------- |
| `set_item_error(item, msg)` | Set the error message of the given item. |
| `set_item_info(item, msg)` | Set the info message of the given item. |
| `set_item_warning(item, msg)` | Set the warning message of the given item. |
| `set_selections(selections[, pane])` | Selected given items in given pane. |
| `show_model(model)` | Show the given model. |
| `show_notification()` | Show the notification frame. |
| `toggle_grid_view(show_grid_view)` | Toggle on/of grid view. |
### Attributes
| Attribute | Description |
| --------- | ----------- |
| `show_grid_view` | Return True if grid view is visible. |
| `show_udim_sequence` | Return True if the list model has UDIM sequence visible. |
### Methods
```python
__init__(title: str, **kwargs)
```
```python
add_model_as_subtree(model: FileBrowserModel, parent: Optional[FileBrowserItem])
### Add a new model as the subtree of the tree view root model or the given parent item.
**Parameters**
- **model** (`FileBrowserModel`) โ the model to add.
- **parent** (`FileBrowserItem`) โ If set, add the model as a child to this item instead of the tree view root model.
### Clear the alert of the given item.
**Parameters**
- **item** (`FileBrowserItem`) โ Item to clear the alert.
### Create a folder item at the given path and add it as child to the tree view root model or the given parent item.
**Parameters**
- **name** (`str`) โ name of the item.
- **path** (`str`) โ path of the item.
- **parent** (`Optional[FileBrowserItem]`) โ If set, add the item as a child to this parent item.
**Returns**
- `FileBrowserItem`
### delete_child
```delete_child```(item: FileBrowserItem, parent: Optional[FileBrowserItem] = None)
Delete an item from the tree view root model or the given parent item.
**Parameters:**
- **item** (FileBrowserItem) โ the item to remove.
- **parent** (FileBrowserItem) โ If set, remove the item from this item instead of the tree view root model.
### delete_child_by_name
```delete_child_by_name```(item_name: str, parent: Optional[FileBrowserItem] = None)
Delete an item from the tree view root model or the given parent item.
**Parameters:**
- **item_name** (str) โ the item name to remove.
- **parent** (FileBrowserItem) โ If set, remove the item from this item instead of the tree view root model.
### destroy
```destroy```()
Destructor. Called by extension before destroying this object. It doesnโt happen automatically. Without this hot reloading doesnโt work.
### get_root
`get_root(pane: Optional[int] = None) -> FileBrowserItem`
- Get the root item of the treeview by pane.
### get_selected_item
`get_selected_item(pane: int = 1) -> FileBrowserItem`
- Return last of selected item from the specified pane.
- **Parameters**
- **pane** (int) โ One of TREEVIEW_PANE, LISTVIEW_PANE. Returns the union if None is specified.
- **Returns**
- `FileBrowserItem` or None
### get_selections
`get_selections(pane: int = 1) -> List[FileBrowserItem]`
- Return list of selected items from the specified pane.
- **Parameters**
- **pane** (int) โ One of TREEVIEW_PANE, LISTVIEW_PANE. Returns the union if None is specified.
- **Returns**
- list[`FileBrowserItem`]
### hide_notification
`hide_notification()`
- Hide the notification frame.
### Link Views
```python
link_views(src_widget: FilePickerWidget)
```
Link this widget to the given widget, i.e. the 2 widgets will thereafter display the same models but not necessarily share the same view.
#### Parameters
- **src_widget** (`FilePickerWidget`) โ The source widget.
### Refresh UI
```python
refresh_ui(item: Optional[FileBrowserItem] = None, listview_only: bool = False)
```
Redraw the subtree rooted at the given item. If item is None, then redraws entire tree.
#### Parameters
- **item** (`FileBrowserItem`) โ Root of subtree to redraw. Default None, i.e. root.
### Scale Grid View
```python
scale_grid_view(scale: float)
```
Set the scale of item inside grid view.
### Select and Center
```python
select_and_center(selection: FileBrowserItem, pane: int = 1)
```
Select and centers the tree view on the given item, expanding the tree if needed.
#### Parameters
- **selection** (`FileBrowserItem`) โ The item to select and center.
- **pane** (`int`) โ The pane number. Default is 1.
### set_expanded
```python
set_expanded(item: FileBrowserItem, expanded: bool, recursive: bool = False)
```
Set the expansion state of the given item.
**Parameters**
- **item** (FileBrowserItem) โ The item to effect.
- **expanded** (bool) โ True to expand, False to collapse.
- **recursive** (bool) โ Apply state recursively to descendent nodes. Default False.
### set_item_alert
```python
set_item_alert(item: FileBrowserItem, alert_level: int, msg: str)
```
Set the alert message of the given item.
**Parameters**
- **item** (FileBrowserItem) โ Item to set alert.
- **alert_level** (int) โ level of alert.
- **msg** (str) โ message to alert.
### set_item_error
```python
set_item_error(item: FileBrowserItem, error_msg: str)
```
Set the error message of the given item.
**Parameters**
- **item** (FileBrowserItem) โ Item to set error.
- **error_msg** (str) โ message of error.
### set_item_error
Set the error message of the given item.
#### Parameters
- **item** (`FileBrowserItem`) โ Item to set alert.
- **alert_level** (`int`) โ level of alert.
- **msg** (`str`) โ message to alert.
### set_item_info
Set the info message of the given item.
#### Parameters
- **item** (`FileBrowserItem`) โ Item to set alert.
- **alert_level** (`int`) โ level of alert.
- **msg** (`str`) โ message to alert.
### set_item_warning
Set the warning message of the given item.
#### Parameters
- **item** (`FileBrowserItem`) โ Item to set alert.
- **alert_level** (`int`) โ level of alert.
- **msg** (`str`) โ message to alert.
### set_selections
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.FileBrowserWidget.set_selections">
<span class="sig-name descname">
<span class="pre">
set_selections
<span class="sig-paren">
(
<em class="sig-param">
<span class="pre">
selections:
<span class="pre">
[<class
<span class="pre">
'omni.kit.widget.filebrowser.model.FileBrowserItem'>],
<span class="pre">
pane:
<span class="pre">
int
<span class="pre">
=
<span class="pre">
1
<span class="sig-paren">
)
<dd>
<p>
Selected given items in given pane.
<dl class="field-list simple">
<dt class="field-odd">
Parameters
<dd class="field-odd">
<ul class="simple">
<li>
<p>
<strong>
selections
(list[
<code class="xref py py-obj docutils literal notranslate">
<span class="pre">
FileBrowserItem
]) โ list of selections.
<li>
<p>
<strong>
pane
(
<em>
int
) โ One of TREEVIEW_PANE, LISTVIEW_PANE, or None for both. Default None.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.FileBrowserWidget.show_model">
<span class="sig-name descname">
<span class="pre">
show_model
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
model
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
FileBrowserModel
<span class="sig-paren">
)
<dd>
<p>
Show the given model.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.FileBrowserWidget.show_notification">
<span class="sig-name descname">
<span class="pre">
show_notification
<span class="sig-paren">
(
<span class="sig-paren">
)
<dd>
<p>
Show the notification frame.
<dl class="py method">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.FileBrowserWidget.toggle_grid_view">
<span class="sig-name descname">
<span class="pre">
toggle_grid_view
<span class="sig-paren">
(
<em class="sig-param">
<span class="n">
<span class="pre">
show_grid_view
<span class="p">
<span class="pre">
:
<span class="w">
<span class="n">
<span class="pre">
bool
<span class="sig-paren">
)
<dd>
<p>
Toggle on/of grid view.
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.FileBrowserWidget.show_grid_view">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
show_grid_view
<dd>
<p>
Return True if grid view is visible.
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.FileBrowserWidget.show_udim_sequence">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
show_udim_sequence
<dd>
<p>
Return True if the list model has UDIM sequence visible.
| 13,926 |
omni.kit.widget.filebrowser.FileSystemItem.md | # FileSystemItem
## FileSystemItem
```python
class omni.kit.widget.filebrowser.FileSystemItem(path: str, fields: FileBrowserItemFields, is_folder: bool = False)
```
Bases: [FileBrowserItem](omni.kit.widget.filebrowser.model.FileBrowserItem.html#omni.kit.widget.filebrowser.model.FileBrowserItem)
A Filebrowser item class for navigating a the local filesystem in a Filebrowser view. Sub-classed from [FileBrowserItem](omni.kit.widget.filebrowser.FileBrowserItem.html#omni.kit.widget.filebrowser.FileBrowserItem).
### Parameters
- **path** (str) โ Path of the item.
- **fields** ([FileBrowserItemFields](omni.kit.widget.filebrowser.FileSystemItem.html#omni.kit.widget.filebrowser.FileSystemItem)) โ Fields of the item.
- **is_folder** (bool) โ Specify the item as a folder.
### Methods
```
### Methods
| Method | Description |
|--------|-------------|
| `__init__(self)` | Initialize the instance. |
| `keep_entry(entry)` | Return True if we want to keep the given entry. |
| `on_list_change_event(event, entry)` | Handle ListEvent changes, should update this item's children list with the corresponding ListEntry. |
| `populate_async(callback_async[, timeout])` | Populate current item asynchronously if not already. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `readable` | Return True if the item is readable. |
| `writeable` | Return True if the item is writable. |
### Detailed Method Descriptions
#### `__init__(self)`
Initialize the instance.
#### `keep_entry(entry)`
Return True if we want to keep the given entry.
- **Parameters**:
- **entry** (`os.DirEntry`) โ directory entry.
#### `on_list_change_event(event, entry)`
Handle ListEvent changes, should update this itemโs children list with the corresponding ListEntry.
Parameters
----------
- **event** (`omni.client.ListEvent`) โ One of of {UNKNOWN, CREATED, UPDATED, DELETED, METADATA, LOCKED, UNLOCKED}.
- **entry** (`omni.client.ListEntry`) โ Updated entry as defined by omni.client.
### `populate_async`
Populate current item asynchronously if not already. Overrides base method.
Parameters
----------
- **callback_async** (`Callable`) โ Function signature is void callback(result, children: [FileBrowserItem]), where result is an Exception type upon error.
- **timeout** (`float`) โ Time out duration on failed server connections. Default 10.0.
Returns
-------
- Result of executing callback.
Return type
-----------
- Any
### `readable`
Return True if the item is readable.
### `writeable`
Return True if the item is writable. | 2,542 |
omni.kit.widget.filebrowser.FileSystemModel.md | # FileSystemModel
## FileSystemModel
```python
class omni.kit.widget.filebrowser.FileSystemModel(name: str, root_path: str = 'C:', **kwargs)
```
Bases: [`FileBrowserModel`](../omni.kit.widget.filebrowser.model/omni.kit.widget.filebrowser.model.FileBrowserModel.html#omni.kit.widget.filebrowser.model.FileBrowserModel)
A Filebrowser model class for navigating a the local filesystem in a Filebrowser view. Sub-classed from [`FileBrowserModel`](omni.kit.widget.filebrowser.FileBrowserModel.html#omni.kit.widget.filebrowser.FileBrowserModel).
### Parameters
- **name** (str) โ Name of root item.
- **root_path** (str) โ Root path. If None, then create empty model. Default โC:โ.
### Keyword Arguments
- **drop_fn** (Callable) โ Function called to handle drag-n-drops. Function signature: `void drop_fn(dst_item: FileBrowserItem, src_item: FileBrowserItem)`
### filter_fn
(Callable) โ This handler should return True if the given Filebrowser view item is visible, False otherwise. Function signature: bool filter_fn(item: FileBrowserItem)
### sort_by_field
(str) โ Name of column by which to sort items in the same folder. Default โnameโ.
### sort_ascending
(bool) โ Sort in ascending order. Default True.
### Methods
| Method | Description |
| --- | --- |
| `__init__(self)` | Constructs AbstractItemModel. |
### Attributes
(No attributes listed)
### __init__(self: omni.ui._ui.AbstractItemModel) -> None
Constructs AbstractItemModel.
#### Keyword Arguments:
- `kwargs` (dict): See below | 1,495 |
omni.kit.widget.filebrowser.filesystem_model.Classes.md | # omni.kit.widget.filebrowser.filesystem_model Classes
## Classes Summary
- **FileSystemItem**
- A Filebrowser item class for navigating a the local filesystem in a Filebrowser view.
- **FileSystemItemFactory**
- Factory to create :obj:`FileSystemItem` instances.
- **FileSystemModel**
- A Filebrowser model class for navigating a the local filesystem in a Filebrowser view. | 382 |
omni.kit.widget.filebrowser.filesystem_model.FileSystemItemFactory.md | # FileSystemItemFactory
## FileSystemItemFactory
Factory to create `FileSystemItem` instances.
### Methods
- `create_entry_item(*args, **kwargs)`
- `create_group_item(*args, **kwargs)`
- `create_omni_entry_item(*args, **kwargs)` | 232 |
omni.kit.widget.filebrowser.filesystem_model.md | # omni.kit.widget.filebrowser.filesystem_model
## Classes Summary
| Class Name | Description |
|------------|-------------|
| [FileSystemItem](omni.kit.widget.filebrowser.filesystem_model/omni.kit.widget.filebrowser.filesystem_model.FileSystemItem.html) | A Filebrowser item class for navigating a the local filesystem in a Filebrowser view. |
| [FileSystemItemFactory](omni.kit.widget.filebrowser.filesystem_model/omni.kit.widget.filebrowser.filesystem_model.FileSystemItemFactory.html) | Factory to create :obj:`FileSystemItem` instances. |
| [FileSystemModel](omni.kit.widget.filebrowser.filesystem_model/omni.kit.widget.filebrowser.filesystem_model.FileSystemModel.html) | A Filebrowser model class for navigating a the local filesystem in a Filebrowser view. | | 767 |
omni.kit.widget.filebrowser.find_thumbnails_for_files_async.md | # find_thumbnails_for_files_async
## find_thumbnails_for_files_async
```python
async omni.kit.widget.filebrowser.find_thumbnails_for_files_async(urls: List[str], generate_missing: bool = True) -> Dict
```
Return a dictionary of thumbnails for the given files.
### Parameters
- **urls** (List[str]) โ List of file Urls.
- **generate_missing** (bool) โ When True, emits a carb event for the missing thumbnails. Set to False to disable this behavior.
### Returns
Dict of all found thumbnails, with file Url as key, and thumbnail Url as value.
### Return type
Dict
``` | 569 |
omni.kit.widget.filebrowser.Functions.md | # omni.kit.widget.filebrowser Functions
## Functions Summary:
| Function | Description |
|----------|-------------|
| clear_clipboard | Clear the clipboard. |
| find_thumbnails_for_files_async | Return a dictionary of thumbnails for the given files. |
| get_clipboard_items | Get browser items. |
| is_clipboard_cut | Return True if items in the clipboard are cut from other items. |
| is_path_cut | Return True if the path are cut from other items or clipboard. |
| list_thumbnails_for_folder_async | Return a dictionary of thumbnails for the files in the given folder. |
| save_items_to_clipboard | Save browser items to clipboard. | | 637 |
omni.kit.widget.filebrowser.grid_view.Classes.md | # omni.kit.widget.filebrowser.grid_view Classes
## Classes Summary
- **FileBrowserGridView**
- UI Widget for display files or folders as icons in a directory in grid view.
- **FileBrowserGridViewDelegate**
- The delegate that manages building browser items under the model as widgets inside the grid view. | 312 |
omni.kit.widget.filebrowser.grid_view.FileBrowserGridView.md | # FileBrowserGridView
## FileBrowserGridView
```python
class omni.kit.widget.filebrowser.grid_view.FileBrowserGridView(model: FileBrowserModel, **kwargs)
```
Bases: `FileBrowserView`
UI Widget for display files or folders as icons in a directory in grid view.
### Keyword Arguments
- **allow_multi_selection** (bool) โ Optional argument to enable multi selection, defaults to True.
- **selection_changed_fn** (Callable) โ Function called when selection changed. Function signature: `void selection_changed_fn(selections: List[FileBrowserItem])`
### Methods
- `__init__(model, **kwargs)`
- `build_ui()`
```
### Methods
| Method | Description |
|--------|-------------|
| `build_ui` ([restore_selections]) | Build the UI of the grid view. |
| `destroy` () | Destructor. |
| `refresh_ui` ([item, selections]) | Throttle the refreshes so that the UI can keep up with multiple refresh directives in succession. |
| `scale_view` (scale) | Change the scale of items inside the grid view. |
| `scroll_top` () | Scroll the widget to top |
| `select_and_center` (item[, callback]) | Select and center the view on the given item. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `selections` | |
### Initialization
```python
__init__(model: FileBrowserModel, **kwargs)
```
### Method Details
```python
build_ui(restore_selections: Optional[List[FileBrowserItem]] = None)
```
**Description:**
Build the UI of the grid view.
**Keyword Arguments:**
- `restore_selections` (List[FileBrowserItem]) โ List of file browser items to restore selection to.
```
```python
destroy()
```
**Description:**
Destructor.
```
```python
refresh_ui(item, selections)
```
**Description:**
Throttle the refreshes so that the UI can keep up with multiple refresh directives in succession.
```
```python
scale_view(scale)
```
**Description:**
Change the scale of items inside the grid view.
```
```python
scroll_top()
```
**Description:**
Scroll the widget to top
```
```python
select_and_center(item[, callback])
```
**Description:**
Select and center the view on the given item.
### destroy
Destructor.
### refresh_ui
Throttle the refreshes so that the UI can keep up with multiple refresh directives in succession.
**Keyword Arguments**
- **item** (`FileBrowserItem`) โ Unused argument, kept for compatibility.
- **selection** (List[`FileBrowserItem`]) โ List of file browser items to set the new selection to.
### scale_view
Change the scale of items inside the grid view.
:param scale: the new scale to set.
:type scale: float
### scroll_top
Scroll the widget to top
### select_and_center
```python
[FileBrowserItem], None]
```
None
```python
=
```
None
```
(
```python
Select and center the view on the given item.
Parameters
----------
- **item** (FileBrowserItem) โ the item to set the new selection to.
- **callback** (Callable) โ optional callback to call after setting the selection. Function signature: void(item: FileBrowserItem)
```
``` | 2,971 |
omni.kit.widget.filebrowser.grid_view.FileBrowserGridViewDelegate.md | # FileBrowserGridViewDelegate
## Class FileBrowserGridViewDelegate
```python
class omni.kit.widget.filebrowser.grid_view.FileBrowserGridViewDelegate(widget: Frame, theme: str, **kwargs)
```
### Description
Bases: `object`
The delegate that manages building browser items under the model as widgets inside the grid view.
### Parameters
- **widget** (`ui.Frame`): The frame for the delegate to build widgets under.
- **theme** (`str`): The theme name to use.
### Keyword Arguments
- **mouse_pressed_fn** (`Callable`): Function called on mouse press. Function signature: `void mouse_pressed_fn(button: int, key_mode: int, item: FileBrowserItem, x: float=0, y: float=0)`
- **mouse_double_clicked_fn** (`Callable`): Function called on mouse double click. Function signature: `void mouse_double_clicked_fn(button: int, key_mode: int, item: FileBrowserItem, x: float=0, y: float=0)`
- **selection_changed_fn** (`Callable`): Function called on selection change. Function signature: `void selection_changed_fn(selected: bool, item: FileBrowserItem)`
```
### Attributes
- **selection_changed_fn** (*Callable*) โ Function called when selection changed. Function signature: `void selection_changed_fn(selections: list[FileBrowserItem])`
- **drop_fn** (*Callable*) โ Function called to handle drag-n-drops. Function signature: `void drop_fn(dst_item: FileBrowserItem, src_path: str)`
- **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)`
- **badges_provider** (*Callable*) โ This callback provides the list of badges to layer atop the thumbnail in the grid view. Callback signature: `List[str] badges_provider(item: FileBrowserItem)`
- **treeview_identifier** (*str*) โ widget identifier for treeview, only used by tests.
- **testing** (*bool*) โ When enabled, forces items to immediately be built and made available.
### Methods
- `__init__(widget, theme, **kwargs)`
- `add_selection(card)` โ Add a new card to selection.
- `build_card(model, item)` โ Create a widget per item.
- `build_grid(model)` โ Build browser items under the model.
- `center_selection_async(selection[, ...])` โ Center the given item and add it to the selection.
- `clear_selections()` โ Clear current selection.
- `destroy()` โ Destructor.
- `extend_selections(cards)` โ Extend current selection.
- `refresh_thumbnails_async(urls)` โ Re-generate the thumbnails with given URLs.
- `remove_selection()` โ Remove the specified item from the selection.
### Methods
| HTML Code | Description |
|-----------|-------------|
| `remove_selection` (card) | Remove a new card from the selection. |
| `update_cards_on_thumbnails_generated` (event) | When new thumbnails are generated, re-renders associated cards. |
| `update_grid` (model) | Generate a grid of cards and renders them with custom thumbnails. |
### Attributes
| HTML Code | Description |
|-----------|-------------|
| `scale` | Get the scale of items. |
| `selections` | Get the current selection. |
### Methods
| Method Name | Parameters | Description |
|-------------|------------|-------------|
| `__init__` | widget: Frame, theme: str, **kwargs | |
| `add_selection` | card: FileBrowserItemCard | Add a new card to selection. |
| | Parameters: |
| | - **card** (FileBrowserItemCard) โ Item widget to add. |
| `build_card` | model: FileBrowserModel, item: FileBrowserItem | |
### FileBrowserGridViewDelegate Methods
#### build_card
- **Description**: Create a widget per item.
- **Parameters**:
- **model** (`FileBrowserModel`) โ model to build the item with.
- **item** (`FileBrowserItem`) โ the item to build the widget.
#### build_grid
- **Description**: Build browser items under the model.
- **Parameters**:
- **model** (`FileBrowserModel`) โ Model containing items to build.
#### center_selection_async
- **Description**: Asynchronously center the selection.
- **Parameters**:
- **selection** (`FileBrowserItem`)
- **scroll_frame** (Optional[`Frame`] = None)
- **scroll_ratio** = 0.0
- **refresh_interval** = 2
- **callback** (Optional[Callable[[`FileBrowserItem`], None]] = None)
### center_selection_async
Center the given item and add it to the selection.
**Parameters**
- **selection** (`FileBrowserItem`) โ Item to center on.
- **scroll_frame** (`ui.Frame`) โ Optional argument frame to scroll to the itemโs new position.
- **scroll_ratio** (`float`) โ Optional argument ratio to scroll to the itemโs new position using item index ratio.
### clear_selections
Clear current selection.
### destroy
Destructor.
### extend_selections
Extend current selection.
**Parameters**
- **cards** (List[`FileBrowserItemCard`]) โ List of item widgets to extend.
### refresh_thumbnails_async
Re-generate the thumbnails with given URLs.
**Parameters**
- **urls** (`List[str]`) โ thumbnail URLs to update.
### remove_selection
Remove a new card from the selection.
**Parameters**
- **card** (`FileBrowserItemCard`) โ Item widget to remove.
When new thumbnails are generated, re-renders associated cards.
**Parameters**
- **events** (`IEvent`) โ event containing the thumbnail URLs to update.
Generate a grid of cards and renders them with custom thumbnails.
**Parameters**
- **model** (`FileBrowserModel`) โ Model containing items to update.
Get the scale of items.
**scale** : `float`
Get the current selection.
**selections** : `List[FileBrowserItem]` | 5,470 |
omni.kit.widget.filebrowser.list_thumbnails_for_folder_async.md | # list_thumbnails_for_folder_async
๏
## list_thumbnails_for_folder_async
๏
```python
async omni.kit.widget.filebrowser.list_thumbnails_for_folder_async(url: str, timeout: float = 30.0, generate_missing: bool = True) -> Dict
```
Return a dictionary of thumbnails for the files in the given folder.
### Parameters
- **url** (str) โ Folder Url.
- **generate_missing** (bool) โ When True, emits a carb event for the missing thumbnails. Set to False to disable this behavior.
### Returns
Dict of all found thumbnails, with file Url as key, and thumbnail Url as value.
### Return type
Dict
``` | 593 |
omni.kit.widget.filebrowser.md | # omni.kit.widget.filebrowser
## Submodules Summary:
- **omni.kit.widget.filebrowser.abstract_column_delegate**
- An abstract column delegate class. Subclassed by column delegates used by :obj:`FileBrowserTreeView`.
- **omni.kit.widget.filebrowser.card**
- Base Model classes for the filebrowser entity.
- **omni.kit.widget.filebrowser.clipboard**
- Collection of utility functions to manage the clipboard.
- **omni.kit.widget.filebrowser.column_delegate_registry**
- Manage Registration of column delegates to be used by :obj:`FileBrowserTreeView`.
- **omni.kit.widget.filebrowser.date_format_menu**
- A menu to set datetime format.
- **omni.kit.widget.filebrowser.filesystem_model**
- Model and Item classes for navigating the local file system on the machine.
- **omni.kit.widget.filebrowser.grid_view**
- A generic GridView Widget for File Systems.
- **omni.kit.widget.filebrowser.model**
- No submodule docstring provided
- **omni.kit.widget.filebrowser.nucleus_model**
- Model and Item classes for navigating a Nucleus Server.
- **omni.kit.widget.filebrowser.singleton**
- Decorator class to define the class as a singleton.
- **omni.kit.widget.filebrowser.style**
- No description provided.
| Description | Summary |
|-------------|---------|
| UI Styles for widgets used in the extension. | UI Styles for widgets used in the extension. |
| omni.kit.widget.filebrowser.thumbnails | Collection of functions to manage thumbnails. |
| omni.kit.widget.filebrowser.tree_view | A generic Tree View Widget for File Systems. |
| omni.kit.widget.filebrowser.view | An abstract View class, subclassed by TreeView and GridView. |
| omni.kit.widget.filebrowser.widget | UI widget for navigating a filesystem. |
| omni.kit.widget.filebrowser.zoom_bar | UI Widget to change the scale of items inside :obj:`FileBrowserGridView`. |
Classes Summary:
| Class | Description |
|-------|-------------|
| AbstractColumnDelegate | An abstract object that is used to put the widget to the file browser asynchronously. |
| ColumnItem | Column Item class to be used with FileBrowserTreeView. |
| FileBrowserItem | Base class for the Filebrowser view Item. |
| FileBrowserItemCard | Widget used by FileBrowserGridView to build the browser item. |
| FileBrowserItemFactory | Factory to create :obj:`FileBrowserItem` instances. |
| FileBrowserModel | Base class for the Filebrowser view Model. |
| FileBrowserUdimItem | A Filebrowser UDIM item class for navigating a the local filesystem in a Filebrowser view. |
| FileBrowserWidget | The basic UI widget for navigating a filesystem as a tree or grid view. |
| FileSystemItem | A Filebrowser item class for navigating a the local filesystem in a Filebrowser view. |
| FileSystemModel | A Filebrowser model class for navigating a the local filesystem in a Filebrowser view. |
| NucleusConnectionItem | NucleusItem that represents a nucleus connection. |
| NucleusItem | A Filebrowser item class for navigating a Nucleus server in a Filebrowser view. |
| NucleusModel | A Filebrowser model class for navigating a Nucleus server in a Filebrowser view. |
| ColumnDelegateRegistry | |
# Functions Summary:
| Function Name | Description |
|---------------|-------------|
| clear_clipboard | Clear the clipboard. |
| find_thumbnails_for_files_async | Return a dictionary of thumbnails for the given files. |
| get_clipboard_items | Get browser items. |
| is_clipboard_cut | Return True if items in the clipboard are cut from other items. |
| is_path_cut | Return True if the path are cut from other items or clipboard. |
| list_thumbnails_for_folder_async | Return a dictionary of thumbnails for the files in the given folder. |
| save_items_to_clipboard | Save browser items to clipboard. | | 3,749 |
omni.kit.widget.filebrowser.model.Classes.md | # omni.kit.widget.filebrowser.model Classes
## Classes Summary
| Class Name | Description |
|------------|-------------|
| [FileBrowserItem](omni.kit.widget.filebrowser.model/omni.kit.widget.filebrowser.model.FileBrowserItem.html) | Base class for the Filebrowser view Item. |
| [FileBrowserItemFactory](omni.kit.widget.filebrowser.model/omni.kit.widget.filebrowser.model.FileBrowserItemFactory.html) | Factory to create :obj:`FileBrowserItem` instances. |
| [FileBrowserModel](omni.kit.widget.filebrowser.model/omni.kit.widget.filebrowser.model.FileBrowserModel.html) | Base class for the Filebrowser view Model. | | 617 |
omni.kit.widget.filebrowser.model.FileBrowserItem.md | # FileBrowserItem
## FileBrowserItem
```
```text
class omni.kit.widget.filebrowser.model.FileBrowserItem
(
path : str,
fields : FileBrowserItemFields,
is_folder : bool = False,
is_deleted : bool = False
)
```
```text
Bases: AbstractItem
Base class for the Filebrowser view Item.
Should be sub-classed to implement specific filesystem behavior. The Constructor should not be
called directly. Instead there are factory methods available for creating instances when needed.
Parameters
-----------
path (str) โ Path of the item.
fields (FileBrowserItemFields) โ Fields of the item.
**is_folder** *(bool)* โ Set to True if the item is a folder.
**is_deleted** *(bool)* โ Set to True if the item is deleted.
## Methods
| Method | Description |
|--------|-------------|
| `__init__(self)` | |
| `add_child(item)` | Add item as child. |
| `datetime_as_string(value)` | Convert datatime to string. |
| `del_child(item_name)` | Delete child item by name. |
| `get_custom_thumbnails_for_folder_async()` | Return the thumbnail dictionary for this (folder) item. |
| `get_subitem_model(index)` | Return ith column of this item. |
| `has_mouse_pressed_fn()` | Check if the item has a mouse pressed callback assigned. |
| `mouse_pressed_fn()` | Mouse pressed callback. |
| `on_list_change_event(event, entry)` | Virtual method to be implemented by sub-class. |
| `on_populated_async([result, children, callback])` | async callback after finish populating the item. |
| `populate_async([callback_async, timeout])` | Populate current item asynchronously if not already. |
| `populate_with_callback(callback[, timeout])` | Populate this item if not already populated. |
| `size_as_string(value)` | |
## Attributes
| Attribute | Description |
|--------------------|-----------------------------------------------------------------------------|
| alert | Get/set alert level and message. |
| children | Children of this item. |
| context_menu | Optionally provide a context menu to be shown when this item is right-clicked. |
| enable_sorting | True if item's children are sortable. |
| expandable | Whether this FileBrowserItem is expandable. |
| fields | A subset of the item's stats stored as a string tuple. |
| hideable | Whether this FileBrowserItem is hideable. |
| icon | Get/set path to icon file. |
| is_deleted | True if this item is a deleted folder/file. |
| is_folder | True if this item is a folder. |
| is_udim_file | Get/Set item udim_file state. |
| item_changed | True if this item is has been restored/deleted already. |
| models | The columns of this item. |
| name | Item name. |
| parent | Parent of this item. |
| Property | Description |
|----------|-------------|
| parent | Parent of this item. |
| path | Full path name. |
| populated | Get/Set item populated state. |
| readable | True if the item is readable. |
| writeable | True if the item is writeable. |
### __init__
- **Parameters:**
- self: omni.ui._ui.AbstractItem
- **Returns:** None
### add_child
- **Description:** Add item as child.
- **Parameters:**
- item (FileBrowserItem): Child item.
### datetime_as_string
- **Parameters:**
- value: datetime
- **Returns:** str
- **Description:** Convert datatime to string.
### del_child
- **Description:** Delete child item by name.
- **Parameters:**
- item_name (str): Name of child item.
### get_custom_thumbnails_for_folder_async
- **Description**: Return the thumbnail dictionary for this (folder) item.
- **Returns**: With children urlโs as keys, and urlโs to thumbnail files as values.
- **Return type**: Dict
### get_subitem_model
- **Description**: Return ith column of this item.
- **Returns**: `AbstractValueModel`
### has_mouse_pressed_fn
- **Description**: Check if the item has a mouse pressed callback assigned.
### mouse_pressed_fn
- **Description**: Mouse pressed callback.
### on_list_change_event
- **Description**: Virtual method to be implemented by sub-class. When called with a ListEvent, should update this itemโs children list with the corresponding ListEntry.
- **Parameters**:
- **event** (`omni.client.ListEvent`) โ One of of {UNKNOWN, CREATED, UPDATED, DELETED, METADATA, LOCKED, UNLOCKED}.
- **entry** (`omni.client.ListEntry`) โ Updated entry as defined by omni.client.
### on_populated_async
- **Description**: async method description here.
:
Optional
[
Dict
[
str
,
FileBrowserItem
]
]
=
None
,
callback
:
Optional
[
Callable
[
[
Dict
[
str
,
FileBrowserItem
]
,
None
]
]
=
None
)
async
populate_async
(
callback_async
:
Optional
[
Callable
]
=
None
,
timeout
:
float
=
10.0
)
->
Any
<dl>
<dt>
<p>
Populate current item asynchronously if not already. Override this method to customize for specific file systems.
<dl class="field-list simple">
<dt class="field-odd">
Parameters
<dd class="field-odd">
<ul class="simple">
<li>
<p>
<strong>callback_async
<li>
<p>
<strong>timeout
<dt class="field-even">
Returns
<dd class="field-even">
<p>
Result of executing callback.
<dt class="field-odd">
Return type
<dd class="field-odd">
<p>
Any
<dd>
<p>
Populate this item if not already populated. When done, executes callback.
<dl class="field-list simple">
<dt class="field-odd">
Parameters
<dd class="field-odd">
<ul class="simple">
<li>
<p>
<strong>callback
<li>
<p>
<strong>timeout
<dt>
<p>
Convert data size in bytes to a human readable string.
<dd>
<p>
Get/set alert level and message.
<dt>
<p>
property children : Dict[str, FileBrowserItem]
<dd>
<p>
Get/set alert level and message.
### Children of this item. Does not populate the item if not already populated.
#### Type
- dict[FileBrowserItem]
### Optionally provide a context menu to be shown when this item is right-clicked.
### True if itemโs children are sortable.
#### Type
- bool
### Whether this FileBrowserItem is expandable. Override to change behavior.
### A subset of the itemโs stats stored as a string tuple.
#### Type
- FileBrowserItemFields
### Whether this FileBrowserItem is hideable. Override to change behavior.
### Get/set path to icon file.
#### Type
- str
### Whether this FileBrowserItem is deleted.
<dl>
<dt>
<p>
True if this item is a deleted folder/file.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
bool
<dd>
<p>
True if this item is a folder.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
bool
<dd>
<p>
Get/Set item udim_file state.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
bool
<dd>
<p>
True if this item is has been restore/delete aready.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
bool
<dd>
<p>
The columns of this item.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
Tuple[
<code>
ui.AbstractValueModel
]
<dd>
<p>
Item name.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
str
<dd>
<p>
Parent of this item.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
FileBrowserItem
<dd>
<p>
path
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
str
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.model.FileBrowserItem.full_path">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
full_path
<em class="property">
<span class="p">
<span class="pre">
:
<span class="w">
<span class="pre">
str
<a class="headerlink" href="#omni.kit.widget.filebrowser.model.FileBrowserItem.full_path" title="Permalink to this definition">
๏
<dd>
<p>
Full path name.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
str
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.model.FileBrowserItem.populated">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
populated
<em class="property">
<span class="p">
<span class="pre">
:
<span class="w">
<span class="pre">
bool
<a class="headerlink" href="#omni.kit.widget.filebrowser.model.FileBrowserItem.populated" title="Permalink to this definition">
๏
<dd>
<p>
Get/Set item populated state.
<dl class="field-list simple">
<dt class="field-odd">
Type
<dd class="field-odd">
<p>
bool
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.model.FileBrowserItem.readable">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
readable
<em class="property">
<span class="p">
<span class="pre">
:
<span class="w">
<span class="pre">
bool
<a class="headerlink" href="#omni.kit.widget.filebrowser.model.FileBrowserItem.readable" title="Permalink to this definition">
๏
<dd>
<p>
True if the item is readable.
<dl class="py property">
<dt class="sig sig-object py" id="omni.kit.widget.filebrowser.model.FileBrowserItem.writeable">
<em class="property">
<span class="pre">
property
<span class="w">
<span class="sig-name descname">
<span class="pre">
writeable
<em class="property">
<span class="p">
<span class="pre">
:
<span class="w">
<span class="pre">
bool
<a class="headerlink" href="#omni.kit.widget.filebrowser.model.FileBrowserItem.writeable" title="Permalink to this definition">
๏
<dd>
<p>
True if the item is writeable.
| 12,412 |
omni.kit.widget.filebrowser.model.FileBrowserItemFactory.md | # FileBrowserItemFactory
## FileBrowserItemFactory
Factory to create `FileBrowserItem` instances.
### Methods
| Method | Description |
| --- | --- |
| `create_dummy_item(name, path)` | Create a dummy item at the given path. |
| `create_group_item(name, path)` | Create a folder item at the given path. |
| `create_udim_item(name, path, range_start, ...)` | Create a UDIM item. |
### create_dummy_item
**Parameters**
- **name** (str) โ name of the item.
- **path** (str) โ path of the item.
### create_group_item
**Parameters**
- **name** (str) โ name of the item.
- **path** (str) โ path of the item.
### create_udim_item
**Parameters**
- **name** (str) โ name of the item.
- **path** (str) โ path of the item.
- **range_start** (int) โ
- **range_end** (int) โ
- **repr_frame** (int) โ
Create a UDIM item.
Parameters
----------
- **name** (`str`) โ name of the item.
- **path** (`str`) โ path of the item.
- **range_start** (`int`) โ Starting index of UDIM sequence.
- **range_end** (`int`) โ End index of UDIM sequence.
- **repr_frame** (`int`) โ Index in UDIM sequence. | 1,080 |
omni.kit.widget.filebrowser.model.FileBrowserModel.md | # FileBrowserModel
## FileBrowserModel
### FileBrowserModel
#### FileBrowserModel
##### FileBrowserModel
###### FileBrowserModel
class omni.kit.widget.filebrowser.model.FileBrowserModel(name: Optional[str] = None, root_path: str = '', **kwargs)
Bases: AbstractItemModel
Base class for the Filebrowser view Model.
Should be sub-classed to implement specific filesystem behavior.
Parameters
-----------
name (str) โ Name of root item. If None given, then create an initally empty model.
Keyword Arguments
------------------
drop_fn (Callable) โ Function called to handle drag-n-drops. Function signature:
void drop_fn(dst_item: FileBrowserItem, src_item: FileBrowserItem)
**filter_fn**(Callable) โ This handler should return True if the given Filebrowser view item is visible, False otherwise. Function signature: bool filter_fn(item: FileBrowserItem)
**sort_by_field**(str) โ Name of column by which to sort items in the same folder. Default โnameโ.
**sort_ascending**(bool) โ Sort in ascending order. Default True.
**timeout**(float) โ Timeout when updating item asynchronously.
## Methods
- **__init__(self)** - Constructs AbstractItemModel.
- **auto_refresh_item(item[, throttle_frames])** - Watch the given folder and updates the children list as soon as its contents are changed.
- **copy_presets(model)** - Reset our fields to default arguments from the given model.
- **destroy()** - Destructor.
- **drop(dst_item, source)** - Invoke user-supplied function to handle dropping source onto destination item.
- **drop_accepted(dst_item, src_item)** - Reimplemented from AbstractItemModel.
- **filter_items(items)** - Return the items filtered with the filter function set.
- **get_drag_mime_data(item)** - Return Multipurpose Internet Mail Extensions (MIME) data for be able to drop this item somewhere.
- **get_item_children(item)** - Return the list of items that are nested to the given parent item.
- **get_item_value_model(item, index)** - Get the value model associated with this item.
- **get_item_value_model_count(item)** - Return the number of columns this model item contains.
| Method Name | Description |
|-------------|-------------|
| `on_list_change_event(item, result, event, entry)` | Process change events for the given folder. |
| `set_filter_fn(filter_fn)` | Set the handler that would return True if the given Filebrowser view item is visible, False otherwise. |
| `sync_up_item_changes(item)` | Scan given folder for missed changes; processes any changes found. |
### Attributes
| Attribute Name | Description |
|----------------|-------------|
| `builtin_column_count` | Return the number of available columns without tag delegates |
| `drag_mime_data` | Return the string with the drag and drop payload. |
| `root` | Get/set the root item of this model. |
| `show_udim_sequence` | Show the UDIM sequence. |
| `single_column` | The panel on the left side works in one-column mode |
| `sort_ascending` | Get/set the sort ascending state. |
| `sort_by_field` | Get/set the sort-by field name. |
### Methods
#### `__init__(self: omni.ui._ui.AbstractItemModel)`
Constructs AbstractItemModel.
**Keyword Arguments:**
- `kwargs: dict` - See below
#### `auto_refresh_item(self)`
Description for auto_refresh_item method.
### auto_refresh_item
- **Parameters**
- **item** (FileBrowserItem) โ The folder item to watch.
- **throttle_frames** โ Number of frames to throttle the UI refresh.
### copy_presets
- **Parameters**
- **model** (FileBrowserModel) โ The model to copy presets from.
### destroy
### drop
- **Parameters**
- **dst_item** (FileBrowserItem) โ Target item.
- **src_item** (FileBrowserItem) โ Source item.
### drop_accepted
```python
drop_accepted(dst_item: FileBrowserItem, src_item: FileBrowserItem) -> bool
```
Reimplemented from AbstractItemModel. Called to highlight target when drag and drop.
Returns True if destination item is able to accept a drop. This function can be
overriden to implement a different behavior.
**Parameters:**
- **dst_item** (FileBrowserItem) โ Target item.
- **src_item** (FileBrowserItem) โ Source item.
**Returns:**
- bool
### filter_items
```python
filter_items(items: List[FileBrowserItem]) -> List[FileBrowserItem]
```
Return the items filtered with the filter function set.
### get_drag_mime_data
```python
get_drag_mime_data(item: FileBrowserItem)
```
Return Multipurpose Internet Mail Extensions (MIME) data for be able to drop this item somewhere.
### get_item_children
```python
get_item_children(item: FileBrowserItem)
```
### get_item_children
Return the list of items that are nested to the given parent item.
#### Parameters
- **item** (`FileBrowserItem`) โ Parent item.
#### Returns
- list[`FileBrowserItem`]
### get_item_value_model
Get the value model associated with this item.
#### Parameters
- **item** (`FileBrowserItem`) โ The item in question.
#### Returns
- `AbstractValueModel`
### get_item_value_model_count
Return the number of columns this model item contains.
#### Parameters
- **item** (`FileBrowserItem`) โ The item in question.
#### Returns
- int
### on_list_change_event
## omni.kit.widget.filebrowser.model.FileBrowserModel.on_list_change_event
### Parameters
- **item** (FileBrowserItem) โ The folder item.
- **result** (omni.client.Result) โ Set by omni.client upon listing the folder.
- **event** (omni.client.ListEvent) โ Event type.
- **throttle_frames** โ Number of frames to throttle the UI refresh.
Process change events for the given folder.
## omni.kit.widget.filebrowser.model.FileBrowserModel.set_filter_fn
Set the handler that would return True if the given Filebrowser view item is visible, False otherwise. Function signature: bool filter_fn(item: FileBrowserItem)
## omni.kit.widget.filebrowser.model.FileBrowserModel.sync_up_item_changes
Scan given folder for missed changes; processes any changes found.
### Parameters
- **item** (FileBrowserItem) โ The folder item to watch.
## Properties
### builtin_column_count
Return the number of available columns without tag delegates
### drag_mime_data
Return the string with the drag and drop payload.
### root
Get/set the root item of this model.
Type: FileBrowserItem
### show_udim_sequence
Show the UDIM sequence.
### single_column
The panel on the left side works in one-column mode
### sort_ascending
Get/set the sort ascending state.
Type: bool
### sort_by_field
Get/set the sort-by field name.
Type: str | 6,425 |
omni.kit.widget.filebrowser.NucleusConnectionItem.md | # NucleusConnectionItem
## NucleusConnectionItem
```python
class omni.kit.widget.filebrowser.NucleusConnectionItem(path: str, fields: FileBrowserItemFields, is_folder: bool = True)
```
**Bases:**
`NucleusItem`
**Description:**
NucleusItem that represents a nucleus connection. Sub-classed from `NucleusItem`.
**Parameters:**
- **path** (str) โ Path of the item.
- **fields** (`FileBrowserItemFields`) โ Fields of the item.
- **is_folder** (bool) โ Specify the item as a folder.
- **is_deleted** (bool) โ Specify the item as deleted.
**Methods:**
| Column 1 | Column 2 |
|----------|----------|
| `__init__` (self) | |
| `signed_in` | Return True when signed in to the Nucleus server. |
### Attributes
#### `__init__`
```python
def __init__(self: omni.ui._ui.AbstractItem) -> None
```
#### `signed_in`
```python
property signed_in
```
Return True when signed in to the Nucleus server.
``` | 897 |
omni.kit.widget.filebrowser.NucleusItem.md | # NucleusItem
## NucleusItem
```python
class omni.kit.widget.filebrowser.NucleusItem(path: str, fields: FileBrowserItemFields, is_folder: bool = True, is_deleted: bool = False)
```
**Bases:** [FileBrowserItem](../omni.kit.widget.filebrowser.model/omni.kit.widget.filebrowser.model.FileBrowserItem.html#omni.kit.widget.filebrowser.model.FileBrowserItem)
A Filebrowser item class for navigating a Nucleus server in a Filebrowser view. Sub-classed from [FileBrowserItem](omni.kit.widget.filebrowser.FileBrowserItem.html#omni.kit.widget.filebrowser.FileBrowserItem).
**Parameters:**
- **path** (str) โ Path of the item.
- **fields** ([FileBrowserItemFields](../omni.kit.widget.filebrowser.model/omni.kit.widget.filebrowser.model.FileBrowserItemFields.html#omni.kit.widget.filebrowser.model.FileBrowserItemFields)) โ Fields of the item.
- **is_folder** (bool) โ Indicates if the item is a folder. Default is `True`.
- **is_deleted** (bool) โ Indicates if the item is deleted. Default is `False`.
- **is_folder** (**bool**) โ Specify the item as a folder.
- **is_deleted** (**bool**) โ Specify the item as deleted.
## Methods
| Method | Description |
| ------ | ----------- |
| `__init__` (self) | |
| `on_list_change_event` (event, entry) | Handle ListEvent changes, should update this item's children list with the corresponding ListEntry. |
| `populate_async` ([callback_async, timeout]) | Populate current item asynchronously if not already. |
## Attributes
| Attribute | Description |
| --------- | ----------- |
| `readable` | Return True if the item is readable. |
| `writeable` | Return True if the writable is readable. |
### `__init__` (self: omni.ui._ui.AbstractItem) -> None
### `on_list_change_event` (event: omni.client.ListEvent, entry: omni.client.ListEntry) -> bool
Handle ListEvent changes, should update this itemโs children list with the corresponding ListEntry.
**Parameters:**
- **event** (`omni.client.ListEvent`) โ One of of {UNKNOWN, CREATED, UPDATED, DELETED, METADATA, LOCKED, UNLOCKED}.
- **entry** (`omni.client.ListEntry`) โ Updated entry as defined by omni.client.
(
callback_async : Optional[Callable] = None,
timeout : float = 10.0
)
โ Any
Populate current item asynchronously if not already. Overrides base method.
Parameters
----------
callback_async
(Callable) โ Function signature is void callback(result, children: [FileBrowserItem]),
where result is an Exception type upon error.
timeout
(float) โ Time out duration on failed server connections. Default 10.0.
Returns
-------
Result of executing callback.
Return type
-----------
Any
property readable : bool
----------------------
Return True if the item is readable.
property writeable : bool
-------------------------
Return True if the writable is readable. | 2,780 |
omni.kit.widget.filebrowser.NucleusModel.md | # NucleusModel
## NucleusModel
```python
class omni.kit.widget.filebrowser.NucleusModel(name: str, root_path: str, **kwargs)
```
**Bases:** [FileBrowserModel](../omni.kit.widget.filebrowser.model/omni.kit.widget.filebrowser.model.FileBrowserModel.html#omni.kit.widget.filebrowser.model.FileBrowserModel)
A Filebrowser model class for navigating a Nucleus server in a Filebrowser view. Sub-classed from [FileBrowserModel](omni.kit.widget.filebrowser.FileBrowserModel.html#omni.kit.widget.filebrowser.FileBrowserModel).
**Parameters:**
- **name** (str) โ Name of root item.
- **root_path** (str) โ Root path. If None, then create empty model. Example: โomniverse://ov-contentโ.
**Keyword Arguments:**
- **drop_fn** (Callable) โ Function called to handle drag-n-drops. Function signature: `void drop_fn(dst_item: FileBrowserItem, src_item: FileBrowserItem)`
- **filter_fn** (Callable) โ This handler should return True if the given Filebrowser view item is visible, False otherwise. Function signature: `bool filter_fn(item: FileBrowserItem)`
```
- **FileBrowserItem**
- **sort_by_field** (*str*) โ Name of column by which to sort items in the same folder. Default โnameโ.
- **sort_ascending** (*bool*) โ Sort in ascending order. Default True.
### Methods
| Method | Description |
|--------|-------------|
| `__init__` (self) | Constructs AbstractItemModel. |
### Attributes
### __init__
(self: omni.ui._ui.AbstractItemModel) โ None
- Constructs AbstractItemModel.
### Keyword Arguments:
- `kwargs` dict: See below | 1,524 |
omni.kit.widget.filebrowser.nucleus_model.Classes.md | # omni.kit.widget.filebrowser.nucleus_model Classes
## Classes Summary
- **NucleusConnectionItem**
- NucleusItem that represents a nucleus connection.
- **NucleusItem**
- A Filebrowser item class for navigating a Nucleus server in a Filebrowser view.
- **NucleusItemFactory**
- Factory to create :obj:`NucleusItem` instances.
- **NucleusModel**
- A Filebrowser model class for navigating a Nucleus server in a Filebrowser view. | 440 |
omni.kit.widget.filebrowser.nucleus_model.NucleusConnectionItem.md | # NucleusConnectionItem
## NucleusConnectionItem
```python
class omni.kit.widget.filebrowser.nucleus_model.NucleusConnectionItem(path: str, fields: FileBrowserItemFields, is_folder: bool = True)
```
Bases: `NucleusItem`
NucleusItem that represents a nucleus connection. Sub-classed from `NucleusItem`.
### Parameters
- **path** (str) โ Path of the item.
- **fields** (`FileBrowserItemFields`) โ Fields of the item.
- **is_folder** (bool) โ Specify the item as a folder.
```
- **is_deleted** (*bool*) โ Specify the item as deleted.
### Methods
| | |
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| __init__ | [__init__](omni.kit.widget.filebrowser.nucleus_model.NucleusConnectionItem.__init__) (self) |
### Attributes
| | |
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| signed_in | [signed_in](omni.kit.widget.filebrowser.nucleus_model.NucleusConnectionItem.signed_in) |
#### __init__
__init__(self: omni.ui._ui.AbstractItem) -> None
#### signed_in
property signed_in
Return True when signed in to the Nucleus server. | 1,954 |
omni.kit.widget.filebrowser.nucleus_model.NucleusItemFactory.md | # NucleusItemFactory
## NucleusItemFactory
Factory to create `NucleusItem` instances.
### Methods
- `create_entry_item(*args, **kwargs)`
- `create_group_item(*args, **kwargs)`
### `__init__()` | 197 |
omni.kit.widget.filebrowser.singleton.Functions.md | # omni.kit.widget.filebrowser.singleton Functions
## Functions Summary:
| Name | Description |
|------------|--------------------|
| [Singleton](omni.kit.widget.filebrowser.singleton/omni.kit.widget.filebrowser.singleton.Singleton.html) | A singleton decorator | | 277 |
omni.kit.widget.filebrowser.style.md | # omni.kit.widget.filebrowser.style
## Classes Summary:
| Class | Description |
|-------|-------------|
| [Path](omni.kit.widget.filebrowser.style/omni.kit.widget.filebrowser.style.Path.html) | PurePath subclass that can make system calls. | | 243 |
omni.kit.widget.filebrowser.style.Path.md | # Path
## Path
```python
class omni.kit.widget.filebrowser.style.Path(*args, **kwargs)
```
Bases: `PurePath`
PurePath subclass that can make system calls.
Path represents a filesystem path but unlike PurePath, also offers methods to do system calls on path objects. Depending on your system, instantiating a Path will return either a PosixPath or a WindowsPath object. You can also instantiate a PosixPath or WindowsPath directly, but cannot instantiate a WindowsPath on a POSIX system or vice versa.
### Methods
| Method | Description |
|--------|-------------|
| `absolute()` | Return an absolute version of this path. |
| `chmod(mode, [, follow_symlinks])` | Change the permissions of the path, like os.chmod(). |
| `cwd()` | Return a new path pointing to the current working directory (as returned by os.getcwd()). |
| `exists()` | Check if the path exists. |
```
- Whether this path exists.
- `expanduser()`
- Return a new path with expanded ~ and ~user constructs (as returned by os.path.expanduser)
- `glob(pattern)`
- Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern.
- `group()`
- Return the group name of the file gid.
- `hardlink_to(target)`
- Make this path a hard link pointing to the same file as `target`.
- `home()`
- Return a new path pointing to the user's home directory (as returned by os.path.expanduser('~')).
- `is_block_device()`
- Whether this path is a block device.
- `is_char_device()`
- Whether this path is a character device.
- `is_dir()`
- Whether this path is a directory.
- `is_fifo()`
- Whether this path is a FIFO.
- `is_file()`
- Whether this path is a regular file (also True for symlinks pointing to regular files).
- `is_mount()`
- Check if this path is a POSIX mount point
- `is_socket()`
- Whether this path is a socket.
- `is_symlink()`
- Whether this path is a symbolic link.
- `iterdir()`
- Iterate over the files in this directory.
| ๆนๆณ | ๆ่ฟฐ |
| --- | --- |
| lchmod (mode) | Like chmod(), except if the path points to a symlink, the symlink's permissions are changed, rather than its target's. |
| link_to (target) | Make the target path a hard link pointing to this path. |
| lstat () | Like stat(), except if the path points to a symlink, the symlink's status information is returned, rather than its target's. |
| mkdir ([mode, parents, exist_ok]) | Create a new directory at this given path. |
| open ([mode, buffering, encoding, errors, ...]) | Open the file pointed by this path and return a file object, as the built-in open() function does. |
| owner () | Return the login name of the file owner. |
| read_bytes () | Open the file in bytes mode, read it, and close the file. |
| read_text ([encoding, errors]) | Open the file in text mode, read it, and close the file. |
| readlink () | Return the path to which the symbolic link points. |
| rename (target) | Rename this path to the target path. |
| replace (target) | Rename this path to the target path, overwriting if that path exists. |
| resolve ([strict]) | Make the path absolute, resolving all symlinks on the way and also normalizing it (for example turning slashes into backslashes under Windows). |
| rglob (pattern) | Recursively yield all existing files (of any kind, including directories) matching the given relative pattern, anywhere in this subtree. |
| rmdir () | Remove this directory. |
| samefile (other_path) | Return whether other_path is the same or not as this file (as returned by os.path.samefile()). |
| Method | Description |
|--------|-------------|
| `stat(*[, follow_symlinks])` | Return the result of the stat() system call on this path, like os.stat() does. |
| `symlink_to(target[, target_is_directory])` | Make this path a symlink pointing to the target path. |
| `touch([mode, exist_ok])` | Create this file with the given access mode, if it doesn't exist. |
| `unlink([missing_ok])` | Remove this file or link. |
| `write_bytes(data)` | Open the file in bytes mode, write to it, and close the file. |
| `write_text(data[, encoding, errors, newline])` | Open the file in text mode, write to it, and close the file. |
### Attributes
#### `__init__()`
#### `absolute()`
Return an absolute version of this path. This function works even if the path doesnโt point to anything.
No normalization is done, i.e. all โ.โ and โ..โ will be kept along. Use resolve() to get the canonical path to a file.
#### `chmod(mode, *[, follow_symlinks=True])`
Change the permissions of the path, like os.chmod().
#### `cwd()`
classmethod
Return a new path pointing to the current working directory (as returned by os.getcwd()).
#### `exists()`
Whether this path exists.
#### `expanduser()`
## Methods
### expanduser
Return a new path with expanded ~ and ~user constructs (as returned by os.path.expanduser)
### glob
Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern.
### group
Return the group name of the file gid.
### hardlink_to
Make this path a hard link pointing to the same file as target.
Note the order of arguments (self, target) is the reverse of os.linkโs.
### home
Return a new path pointing to the userโs home directory (as returned by os.path.expanduser(โ~โ)).
### is_block_device
Whether this path is a block device.
### is_char_device
Whether this path is a character device.
### is_dir
Whether this path is a directory.
### is_fifo
Whether this path is a FIFO.
### is_file
Whether this path is a regular file (also True for symlinks pointing to regular files).
### is_mount
Check if this path is a POSIX mount point
### is_socket
Whether this path is a socket.
### is_symlink
Whether this path is a symlink.
## Path Methods
### is_symlink
Whether this path is a symbolic link.
### iterdir
Iterate over the files in this directory. Does not yield any result for the special paths โ.โ and โ..โ.
### lchmod
Like chmod(), except if the path points to a symlink, the symlinkโs permissions are changed, rather than its targetโs.
### link_to
Make the target path a hard link pointing to this path.
Note this function does not make this path a hard link to target, despite the implication of the function and argument names. The order of arguments (target, link) is the reverse of Path.symlink_to, but matches that of os.link.
Deprecated since Python 3.10 and scheduled for removal in Python 3.12. Use `hardlink_to()` instead.
### lstat
Like stat(), except if the path points to a symlink, the symlinkโs status information is returned, rather than its targetโs.
### mkdir
Create a new directory at this given path.
### open
Open the file pointed by this path and return a file object, as the built-in open() function does.
### owner
### Return the login name of the file owner.
### read_bytes
Open the file in bytes mode, read it, and close the file.
### read_text
Open the file in text mode, read it, and close the file.
### readlink
Return the path to which the symbolic link points.
### rename
Rename this path to the target path.
The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, not the directory of the Path object.
Returns the new Path instance pointing to the target path.
### replace
Rename this path to the target path, overwriting if that path exists.
The target path may be absolute or relative. Relative paths are interpreted relative to the current working directory, not the directory of the Path object.
Returns the new Path instance pointing to the target path.
### resolve
Make the path absolute, resolving all symlinks on the way and also normalizing it (for example turning slashes into backslashes under Windows).
### rglob
Recursively yield all existing files (of any kind, including directories) matching the given relative pattern, anywhere in this subtree.
### rmdir
Remove this directory. The directory must be empty.
### samefile
## Methods
### stat
```python
stat(follow_symlinks=True)
```
Return the result of the stat() system call on this path, like os.stat() does.
### symlink_to
```python
symlink_to(target, target_is_directory=False)
```
Make this path a symlink pointing to the target path. Note the order of arguments (link, target) is the reverse of os.symlink.
### touch
```python
touch(mode=438, exist_ok=True)
```
Create this file with the given access mode, if it doesnโt exist.
### unlink
```python
unlink(missing_ok=False)
```
Remove this file or link. If the path is a directory, use rmdir() instead.
### write_bytes
```python
write_bytes(data)
```
Open the file in bytes mode, write to it, and close the file.
### write_text
```python
write_text(data, encoding=None, errors=None, newline=None)
```
Open the file in text mode, write to it, and close the file. | 8,837 |
omni.kit.widget.filebrowser.Submodules.md | # omni.kit.widget.filebrowser Submodules
## Submodules
Summary:
| Module | Description |
|--------|-------------|
| [omni.kit.widget.filebrowser.abstract_column_delegate](omni.kit.widget.filebrowser.abstract_column_delegate.html) | An abstract column delegate class. Subclassed by column delegates used by :obj:`FileBrowserTreeView`. |
| [omni.kit.widget.filebrowser.card](omni.kit.widget.filebrowser.card.html) | Base Model classes for the filebrowser entity. |
| [omni.kit.widget.filebrowser.clipboard](omni.kit.widget.filebrowser.clipboard.html) | Collection of utility functions to manage the clipboard. |
| [omni.kit.widget.filebrowser.column_delegate_registry](omni.kit.widget.filebrowser.column_delegate_registry.html) | Manage Registration of column delegates to be used by :obj:`FileBrowserTreeView`. |
| [omni.kit.widget.filebrowser.date_format_menu](omni.kit.widget.filebrowser.date_format_menu.html) | A menu to set datetime format. |
| [omni.kit.widget.filebrowser.filesystem_model](omni.kit.widget.filebrowser.filesystem_model.html) | Model and Item classes for navigating the local file system on the machine. |
| [omni.kit.widget.filebrowser.grid_view](omni.kit.widget.filebrowser.grid_view.html) | A generic GridView Widget for File Systems. |
| [omni.kit.widget.filebrowser.model](omni.kit.widget.filebrowser.model.html) | No submodule docstring provided |
| [omni.kit.widget.filebrowser.nucleus_model](omni.kit.widget.filebrowser.nucleus_model.html) | Model and Item classes for navigating a Nucleus Server. |
| [omni.kit.widget.filebrowser.singleton](omni.kit.widget.filebrowser.singleton.html) | Decorator class to define the class as a singleton. |
### UI Styles for widgets used in the extension.
### Collection of functions to manage thumbnails.
### A generic Tree View Widget for File Systems.
### An abstract View class, subclassed by TreeView and GridView.
### UI widget for navigating a filesystem.
### UI Widget to change the scale of items inside :obj:`FileBrowserGridView`. | 2,011 |
omni.kit.widget.filebrowser.thumbnails.Classes.md | # omni.kit.widget.filebrowser.thumbnails Classes
## Classes Summary:
| Class Name | Description |
|------------|-------------|
| [MissingThumbnailError](#) | Raised when Moebius server error | | 194 |
omni.kit.widget.filebrowser.thumbnails.Functions.md | # omni.kit.widget.filebrowser.thumbnails Functions
## Functions Summary
- **find_thumbnails_for_files_async**
- Return a dictionary of thumbnails for the given files.
- **generate_missing_thumbnails_async**
- When missing thumbnails are discovered, send an event to have them generated. The generator
- **list_thumbnails_for_folder_async**
- Return a dictionary of thumbnails for the files in the given folder. | 420 |
omni.kit.widget.filebrowser.thumbnails.generate_missing_thumbnails_async.md | # generate_missing_thumbnails_async
## generate_missing_thumbnails_async
```python
async omni.kit.widget.filebrowser.thumbnails.generate_missing_thumbnails_async(missing_thumbnails: List[str])
```
When missing thumbnails are discovered, send an event to have them generated. The generator service is a separate process. Once generated, a reciprocal event is sent to update the UI. The flow is diagramed below:
```c++
+-----------------------------------+ +------------------------------+
| Filebrowser | | |
| +-------------------------+ | | | |
| | | | | | |
| | update_grid +---------------------------> Thumbnail generator |
| | | | | | service |
| +-------------------------+ | | | |
| +-------------------------+ | | Thumbnails | |
+-----------------------------------+ +------------------------------+
```
| | | | generated event | |
|---|--------------------------|---|------------------------|----------------------------|
| | update_cards_on | | | |
| | thumbnails_generated | | | |
| | | | | |
+-----------------------------------+------------------------------+ | 1,790 |
omni.kit.widget.filebrowser.thumbnails.md | # omni.kit.widget.filebrowser.thumbnails
## Classes Summary:
- **MissingThumbnailError**: Raised when Moebius server error
## Functions Summary:
- **find_thumbnails_for_files_async**: Return a dictionary of thumbnails for the given files.
- **generate_missing_thumbnails_async**: When missing thumbnails are discovered, send an event to have them generated. The generator
- **list_thumbnails_for_folder_async**: Return a dictionary of thumbnails for the files in the given folder. | 481 |
omni.kit.widget.filebrowser.thumbnails.MissingThumbnailError.md | # MissingThumbnailError
## MissingThumbnailError
```python
class omni.kit.widget.filebrowser.thumbnails.MissingThumbnailError(msg: str = '', url: Optional[str] = None)
```
Bases: `Exception`
Raised when Moebius server error
```python
def __init__(msg: str = '', url: Optional[str] = None)
```
**Optional**
[str]
=
None
) | 329 |
omni.kit.widget.filebrowser.tree_view.AwaitWithFrame.md | # AwaitWithFrame
## AwaitWithFrame
```python
class omni.kit.widget.filebrowser.tree_view.AwaitWithFrame(frame: Frame, future: Future)
```
Bases: `object`
A future-like object that runs the given future and makes sure itโs always in the given frameโs scope. It allows for creating widgets asynchronously.
### Methods
| Method | Description |
|--------|-------------|
| `__init__(frame: Frame, future: Future)` | |
``` | 422 |
omni.kit.widget.filebrowser.tree_view.Classes.md | # omni.kit.widget.filebrowser.tree_view Classes
## Classes Summary
- **AwaitWithFrame**
- A future-like object that runs the given future and makes sure itโs
- **FileBrowserTreeView**
- UI Widget for display files or folders as icons in a directory in tree view.
- **FileBrowserTreeViewDelegate**
- The delegate that manages building browser items under the model as widgets inside the tree view. | 404 |
omni.kit.widget.filebrowser.tree_view.FileBrowserTreeView.md | # FileBrowserTreeView
## FileBrowserTreeView
```python
class omni.kit.widget.filebrowser.tree_view.FileBrowserTreeView(model: FileBrowserModel, **kwargs)
```
Bases: `FileBrowserView`
UI Widget for display files or folders as icons in a directory in tree view.
### Keyword Arguments
- **root_visible** (bool) โ Set to True to show the root item.
- **header_visible** (bool) โ Set to True to show the column headers.
- **allow_multi_selection** (bool) โ Optional argument to enable multi selection, defaults to True.
- **selection_changed_fn** (Callable) โ Function called when selection changed. Function signature: `void selection_changed_fn(selections: List[FileBrowserItem])`
- **mouse_pressed_fn** (Callable) โ Function called on mouse press. Function signature: `void mouse_pressed_fn(item: FileBrowserItem, x: float, y: float, button: int, key_mode: int)`
```
- **mouse_double_clicked_fn** (`Callable`) โ Function called on mouse double click. Function signature:
```python
void mouse_double_clicked_fn(item: FileBrowserItem, x: float, y: float, button: int, key_mode: int)
```
- **treeview_identifier** (`str`) โ widget identifier for treeview, only used by tests.
### Methods
| Method | Description |
|--------|-------------|
| `__init__` (model, **kwargs) | |
| `build_ui` () | Build the tree view. |
| `destroy` () | Destructor. |
| `is_expanded` (item) | Return True if the item is expanded. |
| `refresh_ui` ([item]) | Throttle the refreshes so that the UI can keep up with multiple refresh directives in succession. |
| `scroll_top` () | Scroll the widget to top |
| `select_and_center` (item) | Select and center the view on the given item. |
| `set_expanded` (item, expanded[, recursive]) | Set the expansion state of the given item. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `selections` | Get selected items in the tree view. |
| `tree_view` | Get the tree view. |
#### `__init__`
```python
__init__(model: FileBrowserModel, **kwargs)
### `__init__`
```python
def __init__(self, *args, **kwargs)
```
### `build_ui`
```python
def build_ui()
```
Build the tree view.
### `destroy`
```python
def destroy()
```
Destructor.
### `is_expanded`
```python
def is_expanded(item: FileBrowserItem) -> bool
```
Return True if the item is expanded.
### `refresh_ui`
```python
def refresh_ui(item: Optional[FileBrowserItem] = None)
```
Throttle the refreshes so that the UI can keep up with multiple refresh directives in succession.
**Parameters**
- **item** (`FileBrowserItem`) โ The item to refresh.
### `scroll_top`
```python
def scroll_top()
```
Scroll the widget to top
### `select_and_center`
```python
def select_and_center(item: FileBrowserItem)
```
Select and center the view on the given item.
**Parameters**
- **item** (`FileBrowserItem`) โ the item to set the new selection to.
(
item : FileBrowserItem,
expanded : bool,
recursive : bool = False
)
Set the expansion state of the given item.
Parameters:
- **item** (FileBrowserItem) โ The item to effect.
- **expanded** (bool) โ True to expand, False to collapse.
- **recursive** (bool) โ Apply state recursively to descendent nodes. Default False.
property selections
Get selected items in the tree view.
property tree_view
Get the tree view. | 3,274 |
omni.kit.widget.filebrowser.tree_view.FileBrowserTreeViewDelegate.md | # FileBrowserTreeViewDelegate
## FileBrowserTreeViewDelegate
```python
class omni.kit.widget.filebrowser.tree_view.FileBrowserTreeViewDelegate(headers: Tuple[str], theme: str, **kwargs)
```
Bases: `AbstractItemDelegate`
The delegate that manages building browser items under the model as widgets inside the tree view.
### Parameters
- **headers** (Tuple[str]) โ Tuple of columns to show in the tree view.
- **theme** (str) โ The theme name to use.
### Keyword Arguments
- **mouse_pressed_fn** (Callable) โ Function called on mouse press. Function signature: void mouse_pressed_fn(item: `FileBrowserItem`, x: float, y: float, button: int, key_mode: int)
- **mouse_double_clicked_fn** (Callable) โ Function called on mouse double click. Function signature:
```
### Events
- `mouse_double_clicked_fn(item: FileBrowserItem, x: float, y: float, button: int, key_mode: int)`
- Function called when item double clicked.
- `column_clicked_fn(Callable)`
- Function called when column clicked. Function signature: `void column_clicked_fn(column_id: int)`
- `datetime_format_changed_fn(Callable)`
- Function called when datetime format changed. Function signature: `void datetime_format_changed_fn()`
- `sort_by_column(int)`
- The column index to sort items, defaults to 0.
- `sort_ascending(bool)`
- Sort in ascending or otherwise descending order, defaults to ascending.
- `builtin_column_count(int)`
- Set count of builtin columns.
- `icon_provider(object)`
- Set this to override default icons.
### Methods
- `__init__(self)`
- Constructs AbstractItemDelegate.
- `build_branch(model, item, column_id, level, ...)`
- Create a branch widget that opens or closes subtree.
- `build_header(column_id)`
- Build the given column.
- `build_widget(model, item, column_id, level, ...)`
- Create a widget per item.
- `clear_futures()`
- Stop and destroy all working futures.
- `destroy()`
- Destructor.
- `set_column_delegates(delegates)`
- Add custom columns.
### Attributes
- `sort_ascending`
- Return True when sort in ascending order.
- `sort_by_column`
- Return the column index used for sorting.
### omni.kit.widget.filebrowser.tree_view.FileBrowserTreeViewDelegate.__init__
Constructs AbstractItemDelegate.
#### Keyword Arguments:
- `kwargs` (dict) - See below
### omni.kit.widget.filebrowser.tree_view.FileBrowserTreeViewDelegate.build_branch
Create a branch widget that opens or closes subtree.
#### Parameters:
- **model** (`FileBrowserModel`) โ The model to build the branch with.
- **item** (`FileBrowserItem`) โ The item to build.
- **column_id** (int) โ ID of the column.
- **level** (int) โ level of the item inside the tree.
- **expanded** (bool) โ Set if the item is expanded.
### omni.kit.widget.filebrowser.tree_view.FileBrowserTreeViewDelegate.build_header
Build the given column.
#### Parameters:
- **column_id** (int) โ ID of the column.
### omni.kit.widget.filebrowser.tree_view.FileBrowserTreeViewDelegate.build_widget
Build a widget.
#### Parameters:
- **model** (`FileBrowserModel`) โ The model to build the widget with.
- **item** (`FileBrowserItem`) โ The item to build.
- **column_id** (int) โ ID of the column.
- **level** (int) โ level of the item inside the tree.
- **expanded** (bool) โ Set if the item is expanded.
### FileBrowserTreeViewDelegate Methods
#### build_widget
```python
def build_widget(model: FileBrowserModel, item: FileBrowserItem, column_id: int, level: int, expanded: bool):
```
Create a widget per item.
**Parameters:**
- **model** (`FileBrowserModel`) โ The model to build the widget with.
- **item** (`FileBrowserItem`) โ The item to build.
- **column_id** (`int`) โ ID of the column.
- **level** (`int`) โ level of the item inside the tree.
- **expanded** (`bool`) โ Set if the item is expanded.
#### clear_futures
```python
def clear_futures():
```
Stop and destroy all working futures
#### destroy
```python
def destroy():
```
Destructor.
#### set_column_delegates
```python
def set_column_delegates(delegates: List[AbstractColumnDelegate]):
```
Add custom columns
#### sort_ascending
```python
property sort_ascending: bool
## Property Definitions
### sort_in_ascending_order
- **Description:** Return True when sort in ascending order.
### sort_by_column
- **Type:** int
- **Description:** Return the column index used for sorting. | 4,328 |
omni.kit.widget.filebrowser.view.Classes.md | # omni.kit.widget.filebrowser.view Classes
## Classes Summary
| Class Name | Description |
|------------|-------------|
| [FileBrowserView](omni.kit.widget.filebrowser.view/omni.kit.widget.filebrowser.view.FileBrowserView.html) | Base class for :obj:`FileBrowserGridView` and :obj:`FileBrowserTreeView`. | | 307 |
omni.kit.widget.filebrowser.view.FileBrowserView.md | # FileBrowserView
## FileBrowserView
```python
class omni.kit.widget.filebrowser.view.FileBrowserView(model: FileBrowserModel)
```
Bases: `object`
Base class for `FileBrowserGridView` and `FileBrowserTreeView`.
**Parameters**
- **model** (`FileBrowserModel`) โ the model to use.
**Methods**
- `__init__(model)`
- `build_ui()` - Build the UI.
- `destroy()` - Destructor.
```
| Method | Description |
|--------|-------------|
| `refresh_ui([item])` | Update the UI. |
| `select_and_center(item)` | Select and center the view on the given item. |
| `set_root(item)` | Set the root item. |
### Attributes
| Attribute | Description |
|-----------|-------------|
| `model` | Return the model of the view. |
| `visible` | Return visiblity of the view. |
### Methods
#### `__init__(model: FileBrowserModel)`
Initialize the view with a model.
#### `build_ui()`
Build the UI.
#### `destroy()`
Destructor.
#### `refresh_ui(item: Optional[FileBrowserItem] = None)`
Update the UI.
Parameters:
- `item` (FileBrowserItem) โ The item to refresh.
### select_and_center
```abstract```
```select_and_center```(item: ```FileBrowserItem```)
Select and center the view on the given item.
:param item: the item to set the new selection to.
:type item: ```FileBrowserItem```
### set_root
```set_root```(item: ```FileBrowserItem```)
Set the root item.
### model
```property```
```model```
Return the model of the view.
### visible
```property```
```visible```
Return visibility of the view. | 1,483 |
omni.kit.widget.filebrowser.widget.Classes.md | # omni.kit.widget.filebrowser.widget Classes
## Classes Summary:
| Class Name | Description |
|------------|-------------|
| [FileBrowserWidget](omni.kit.widget.filebrowser.widget/omni.kit.widget.filebrowser.widget.FileBrowserWidget.html) | The basic UI widget for navigating a filesystem as a tree or grid view. | | 316 |
omni.kit.widget.filebrowser.widget.md | # omni.kit.widget.filebrowser.widget
## Classes Summary:
- **FileBrowserWidget**
- The basic UI widget for navigating a filesystem as a tree or grid view. | 156 |
omni.kit.widget.filebrowser.zoom_bar.Classes.md | # omni.kit.widget.filebrowser.zoom_bar Classes
## Classes Summary:
| Class | Description |
|-------|-------------|
| [ZoomBar](omni.kit.widget.filebrowser.zoom_bar/omni.kit.widget.filebrowser.zoom_bar.ZoomBar.html) | Widget to control the scale of items inside :obj:`FileBrowserGridView`. | | 292 |
Subsets and Splits