CollectionItem#
- class omni.kit.window.filepicker.CollectionItem(
- identifier: str,
- title: str,
- icon: str,
- access: int = 3,
- populated: bool = True,
- order: int = 10000,
- *,
- protocol: str | None = None,
Bases:
FileBrowserItemMethods
__init__(identifier, title, icon[, access, ...])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.
Return the thumbnail dictionary for this (folder) item.
Attributes
Deprecated.
Children of this item.
List of avalible children of this item.
List of connections of this item.
- __init__(
- identifier: str,
- title: str,
- icon: str,
- access: int = 3,
- populated: bool = True,
- order: int = 10000,
- *,
- protocol: str | None = None,
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 (e.g. “omniverse”, “http”, “bookmarks”).
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.
Note
The legacy ``protocol`` positional argument is deprecated. The old signature ``(identifier, title, protocol, icon, …)`` is still accepted at runtime for backward compatibility but emits a deprecation log. Use ``(identifier, title, icon, …)`` instead.
- accept_url(
- url: str,
- server_type: str | None = None,
Check if the url is accepted by the collection.
- Parameters:
url (str) – Url to check.
server_type (str) – Deprecated and ignored. Retained for backward compatibility.
- Returns:
True if the url is accepted, False otherwise.
- Return type:
bool
- add_child(
- item: FileBrowserItem,
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,
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,
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]
- async 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
- property add_new_item: AddNewItem | None#
Deprecated. The add-new item is now owned by the collection subclass directly.
- 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]