FileSystemFolder#

class omni.kit.browser.asset.model.FileSystemFolder(*args, **kwargs)#

Bases: AbstractBrowserFolder

Represents a folder in file system. Could be local folder or folder on omniverse server. :keyword root: If a root folder need to check connection status. Default False :kwtype root: bool :keyword ignore_empty_folder: Ignore empty folder. Default False :kwtype ignore_empty_folder: bool :keyword ignore_file_without_thumbnail: Ignore file without thumbnail. Default False :kwtype ignore_file_without_thumbnail: bool

Overridden functions:
async bool start_traverse(): Start travserse to get all sub folders and filess in this folder.

Notices: This is a coroutine and needs to be called in the correct way. for example, use await in other coroutine,or use asyncio.ensure_furture.

Other args and Keyword args: Please refer to AbstractBrowserFolder.

Methods

__init__(*args, **kwargs)

create_file_object(url)

Create file object.

create_folder_object(name, url, **kwargs)

Create a folder object when a sub folder found.

destroy()

start_traverse([try_connect_nucleus, ...])

Start traverse folder to get sub folders and files :keyword try_connect_nucleus: Try connection to nucleus if not connected.

Attributes

__init__(*args, **kwargs)#
create_file_object(
url: str,
) FileSystemFile#

Create file object. :param url: File Url.

Return file object.

create_folder_object(
name: str,
url: str,
**kwargs,
) AbstractBrowserFolder#

Create a folder object when a sub folder found. Default using FileSystemFolder. User could overridden to create own folder object for special usage. Args and keyword args please reference to FileSystemFolder.

async start_traverse(
try_connect_nucleus: bool = True,
on_connected_fn: Callable[[AbstractBrowserFolder, bool], None] = None,
) bool#

Start traverse folder to get sub folders and files :keyword try_connect_nucleus: Try connection to nucleus if not connected. Default True. :kwtype try_connect_nucleus: bool :keyword on_connected_fn: Callback function on connection result. :kwtype on_connected_fn: Callable

Return True if traverse done. Otherwise False means waiting for connection result.