Extension: omni.kit.widget.filebrowser-2.10.51

Documentation Generated: Nov 07, 2024

Overview

This extension provides a widget to navigate through a filesystem while offering two options to display it, tree view and grid view.

  • Tree View

  • Grid View

Both views can mount multiple directories locally on the machine or remotely on servers, with remote servers being Omniverse Nucleus Servers. At the bottom of the hierarchy are file browser items which can be either folders or files.

FileBrowserItem
FileBrowserModel
FileBrowserView
FileSystemItem
NucleusItem
Omniverse Nucleus Servers(NucleusModel)
Directories(FileSystemModel)
table.usd
chair.usd
fruits
animals
dog.usd
cat.usd
goat.usd
apple.usd
pear.usd
script1.py
script2.py
/assets
/source
/data
omniverse://ov-content
omniverse://ov-test
FileBrowserTreeView
FileBrowserGridView
FileBrowserWidget

Example

Here is a example to create the file browser widget under a window and adding a model to display items under “ov-content” server.

window = ui.Window("DemoFileBrowser", width=1000, height=500)
with window.frame:
    browser = FileBrowserWidget("Demo",
        allow_multi_selection=False,
        show_grid_view=True,
        # Only keep folders and USD files
        filter_fn=lambda item: item is not None and item._is_folder or item.path.endswith(".usd")
    )
    # Add a model NucleusModel or FileSystemModel
    model = NucleusModel("ov-content", "omniverse://ov-content")
    browser.add_model_as_subtree(model)