CollectionItem#

class omni.kit.window.filepicker.CollectionItem(
identifier: str,
title: str,
protocol: str,
icon: str,
access: int = 3,
populated: bool = True,
order=10000,
)#

Bases: FileBrowserItem

Methods

__init__(identifier, title, protocol, icon)

Item for a collection which is a singleton that manages the a set of connections/bookmarks/drivers for the browser.

accept_url(url[, server_type])

Check if the url is accepted by the collection.

add_child(item)

Add item as child.

add_path(name, path[, is_folder])

Add a path to the collection.

create_child_item(name, path[, is_folder])

Create a connection item.

Attributes

add_new_item(*args, **kwargs)

Add new connection item.

children

Children of this item.

children_list

List of avalible children of this item.

connections

List of connections of this item.

__init__(
identifier: str,
title: str,
protocol: str,
icon: str,
access: int = 3,
populated: bool = True,
order=10000,
)#

Item for a collection which is a singleton that manages the a set of connections/bookmarks/drivers for the browser.

Parameters:
  • identifier (str) – Identifier of the collection. Could be “omniverse” or “https”.

  • title (str) – Title of the collection.

  • icon (str) – Icon of the collection.

  • access (int) – Access flags of the collection. Default is omni.client.AccessFlags.READ | omni.client.AccessFlags.WRITE.

  • populated (bool) – Whether the collection is populated. Default is True. If False, will populate the collection when list children.

  • order (int) – Order of the collection. Default is 10000.

accept_url(
url: str,
server_type: str | None = None,
) bool#

Check if the url is accepted by the collection.

Parameters:

url (str) – Url to check.

Returns:

True if the url is accepted, False otherwise.

Return type:

bool

add_child(
item: FileBrowserItem,
) FileBrowserItem | None#

Add item as child.

Parameters:

item (FileBrowserItem) – Child item.

Returns:

The added item.

Return type:

FileBrowserItem

add_path(
name: str,
path: str,
is_folder: bool = True,
) FileBrowserItem | None#

Add a path to the collection.

Parameters:
  • name (str) – Name the path.

  • path (str) – Path.

  • is_folder (bool) – Whether the path represents a folder.

Returns:

The added child item.

Return type:

Optional[FileBrowserItem]

create_child_item(
name: str,
path: str,
is_folder: bool = True,
) FileBrowserItem | None#

Create a connection item. Override this method to create a custom connection item.

Parameters:
  • name (str) – Name of the item.

  • path (str) – Path of the item.

  • is_folder (bool) – Whether the item is a folder.

Returns:

The created child item.

Return type:

Optional[FileBrowserItem]

add_new_item(*args, **kwargs)#

Add new connection item.

Type:

Optional[AddNewItem]

property children: Dict[str, FileBrowserItem]#

Children of this item. Does not populate the item if not already populated.

Type:

dict[FileBrowserItem]

property children_list: List[FileBrowserItem]#

List of avalible children of this item. Does not include the add new connection item.

Type:

List[FileBrowserItem]

property connections: List[FileBrowserItem]#

List of connections of this item.

Type:

List[FileBrowserItem]