ExtensionManager#
- class omni.ext.ExtensionManager#
Bases:
pybind11_objectManages Omniverse extensions: discovery, enable/disable, and registry I/O.
Methods
__init__(*args, **kwargs)add_path(self, path, type)Adds a folder to monitored extension paths.
add_path_protocol_provider(self, scheme, ...)Add new path protocol provider, scheme must be unique `false` returned otherwise.
add_registry_provider(self, name, provider)Add registry provider to be used for remote extension registry.
Fetches all extension packages; returns tuple of dicts.
fetch_extension_packages(self, arg0)Fetches all packages for an extension fullname; returns tuple of dicts.
Fetches summaries for all extensions from registry; returns tuple of dicts.
fetch_extension_versions(self, arg0)Fetches all versions for an extension fullname; returns tuple of dicts.
get_change_event_stream(self)Gets the change event stream (deprecated).
get_enabled_extension_id(self, ext_name)Returns the enabled extension id for an extension fullname, if any.
Get all python modules of enabled extensions
get_extension_dict(self, ext_id)Gets the carb.dictionary.Item for an extension id.
get_extension_id_by_module(module)Get enabled extension id that contains this python module.
get_extension_packages(self)Returns a tuple of installed extension packages (as dicts).
get_extension_path(self, ext_id)Gets the on-disk path for an extension id.
get_extension_path_by_module(module)Get enabled extension path that contains this python module.
get_extensions(self)Returns a tuple of installed extensions (as dicts).
get_folders(self)Get folders monitored for python extensions.
get_hooks(self)Gets the hook interface.
get_registry_extension_dict(self, ext_id)Gets the registry dictionary for an extension id.
Returns a tuple of extension packages available in the registry (as dicts).
get_registry_extensions(self)Returns a tuple of extensions available in the registry (as dicts).
get_registry_providers(self)Returns a tuple of registered registry providers (as dicts).
is_extension_enabled(self, ext_name)Returns True if an extension fullname is currently enabled.
pack_extension(ext_id, output_folder)Pack extension into archive.
Processes and applies all pending changes.
publish_extension(self, ext_id[, ...])Publishes an extension to a registry provider.
pull_extension(self, ext_id)Pulls an extension's content locally.
pull_extension_async(self, ext_id)Starts an asynchronous pull of an extension.
refresh_registry(self)Refreshes the extension registry.
remove_path(self, path)Removes a folder from monitored extension paths.
remove_path_protocol_provider(self, scheme)Removes a path protocol provider.
remove_registry_provider(self, name)Remove registry provider.
set_extension_enabled(self, extension_id, ...)Toggle extension enable/disable.
set_extension_enabled_immediate(self, ...)Toggle extension enable/disable immediately.
set_extensions_excluded(self, exts)Set extensions to exclude on following solver/startup routines.
solve_extensions(self, exts[, add_enabled, ...])Run extension dependencies solver on the input.
subscribe_to_extension_enable(self, ...)Call callback if extension is enabled and hook in extension system to wait for extension to be enabled again (after reload for instance) and disabled.
sync_registry(self)Synchronizes the extension registry.
uninstall_extension(self, ext_id)Uninstalls an extension from disk.
unpublish_extension(self, ext_id[, ...])Removes a previously published extension from a provider.
- __init__(*args, **kwargs)#
- add_path(
- self: omni.ext._extensions.ExtensionManager,
- path: str,
- type: omni.ext._extensions.ExtensionPathType = <ExtensionPathType.COLLECTION: 0>,
Adds a folder to monitored extension paths.
- add_path_protocol_provider(
- self: omni.ext._extensions.ExtensionManager,
- scheme: str,
- on_add_path_fn: Callable[[str], str],
- on_remove_path_fn: Callable[[str], None],
Add new path protocol provider, scheme must be unique `false` returned otherwise.
- Parameters:
scheme (str) – Scheme name.
fn (Callable[[str], str]) – The callback to be called when new search path is added for this scheme.
- add_registry_provider(
- self: omni.ext._extensions.ExtensionManager,
- name: str,
- provider: omni::ext::IRegistryProvider,
Add registry provider to be used for remote extension registry.
- Parameters:
name (str) – Provider unique name.
provider (IRegistryProvider) – Provider.
- fetch_all_extension_packages( ) tuple#
Fetches all extension packages; returns tuple of dicts.
- fetch_extension_packages(
- self: omni.ext._extensions.ExtensionManager,
- arg0: str,
Fetches all packages for an extension fullname; returns tuple of dicts.
- fetch_extension_summaries( ) tuple#
Fetches summaries for all extensions from registry; returns tuple of dicts.
- fetch_extension_versions(
- self: omni.ext._extensions.ExtensionManager,
- arg0: str,
Fetches all versions for an extension fullname; returns tuple of dicts.
- get_change_event_stream( ) carb.events._events.IEventStream#
Gets the change event stream (deprecated).
- get_enabled_extension_id(
- self: omni.ext._extensions.ExtensionManager,
- ext_name: str,
Returns the enabled extension id for an extension fullname, if any.
- get_enabled_extension_module_names()#
Get all python modules of enabled extensions
- get_extension_dict(
- self: omni.ext._extensions.ExtensionManager,
- ext_id: str,
Gets the carb.dictionary.Item for an extension id.
- get_extension_id_by_module(module: str) str#
Get enabled extension id that contains this python module.
- get_extension_packages( ) tuple#
Returns a tuple of installed extension packages (as dicts).
- get_extension_path(
- self: omni.ext._extensions.ExtensionManager,
- ext_id: str,
Gets the on-disk path for an extension id.
- get_extension_path_by_module(module: str) str#
Get enabled extension path that contains this python module.
- get_extensions( ) tuple#
Returns a tuple of installed extensions (as dicts).
- get_folders( ) tuple#
Get folders monitored for python extensions.
- Returns (List[Dict]):
List of folders. Each folder is dict with “path” and “builtin” key.
- get_hooks( ) omni::ext::IExtensionManagerHooks#
Gets the hook interface.
- get_registry_extension_dict(
- self: omni.ext._extensions.ExtensionManager,
- ext_id: str,
Gets the registry dictionary for an extension id.
- get_registry_extension_packages( ) tuple#
Returns a tuple of extension packages available in the registry (as dicts).
- get_registry_extensions( ) tuple#
Returns a tuple of extensions available in the registry (as dicts).
- get_registry_providers( ) tuple#
Returns a tuple of registered registry providers (as dicts).
- is_extension_enabled(
- self: omni.ext._extensions.ExtensionManager,
- ext_name: str,
Returns True if an extension fullname is currently enabled.
- pack_extension(
- ext_id: str,
- output_folder: str,
Pack extension into archive.
Supports both single file extensions (kit files) and folders.
- Parameters:
ext_id (str) – Local extension id.
output_folder – Folder to output archive into.
- Returns:
Path to archived extension.
- Return type:
str
- process_and_apply_all_changes( ) None#
Processes and applies all pending changes.
- publish_extension(
- self: omni.ext._extensions.ExtensionManager,
- ext_id: str,
- provider_name: str = '',
- allow_overwrite: bool = False,
Publishes an extension to a registry provider.
- pull_extension(
- self: omni.ext._extensions.ExtensionManager,
- ext_id: str,
Pulls an extension’s content locally.
- pull_extension_async(
- self: omni.ext._extensions.ExtensionManager,
- ext_id: str,
Starts an asynchronous pull of an extension.
- refresh_registry( ) None#
Refreshes the extension registry.
- remove_path(
- self: omni.ext._extensions.ExtensionManager,
- path: str,
Removes a folder from monitored extension paths.
- remove_path_protocol_provider(
- self: omni.ext._extensions.ExtensionManager,
- scheme: str,
Removes a path protocol provider.
- remove_registry_provider(
- self: omni.ext._extensions.ExtensionManager,
- name: str,
Remove registry provider.
- Parameters:
name (str) – Provider unique name.
- set_extension_enabled(
- self: omni.ext._extensions.ExtensionManager,
- extension_id: str,
- enabled: bool,
Toggle extension enable/disable.
- Parameters:
extension_id (str) – Extension id. Full python module name, returned by `get_extensions`.
enabled (bool) – Enable/disable toggle.
- set_extension_enabled_immediate(
- self: omni.ext._extensions.ExtensionManager,
- extension_id: str,
- enabled: bool,
Toggle extension enable/disable immediately.
- Parameters:
extension_id (str) – Extension id. Full python module name, returned by `get_extensions`.
enabled (bool) – Enable/disable toggle.
- Returns (bool):
Failure or success.
- set_extensions_excluded(
- self: omni.ext._extensions.ExtensionManager,
- exts: List[str],
Set extensions to exclude on following solver/startup routines. They persist until next call to this function.
- Parameters:
extensions (List[str]) – List Extension id with or without versions.
- solve_extensions(
- self: omni.ext._extensions.ExtensionManager,
- exts: List[str],
- add_enabled: bool = False,
- return_only_disabled: bool = False,
Run extension dependencies solver on the input.
Input is a list of extension, they can be names, full id, partial versions like `ommi.foo-2`.
- Parameters:
exts (List[str]) – List of extensions.
add_enabled (bool) – Automatically add already enabled extension to the input (to take into account)
return_only_disabled (bool) – If true exclude from the result extensions that are currently already enabled
- Returns(Tuple[bool, List[str], str]):
Tuple of result, list of extensions (solution) and error message.
- subscribe_to_extension_enable(
- self: omni.ext._extensions.ExtensionManager,
- on_enable_fn: Callable[[str], None],
- on_disable_fn: Callable[[str], None] = None,
- ext_name: str = '',
- hook_name: str = '',
Call callback if extension is enabled and hook in extension system to wait for extension to be enabled again (after reload for instance) and disabled.
Example:
def on_ext_enabled(ext_id: str): print("enabled:" + ext_id) def on_ext_disabled(ext_id: str): print("disabled:" + ext_id) manager = omni.kit.app.get_app().get_extension_manager() self.hooks = manager.subscribe_to_extension_enable(on_ext_enabled, on_ext_disabled, ext_name="omni.kit.window.console", hook_name="la la la") # Notice that we stored subscription holder somewhere (in self for instance) to hold it.
- Parameters:
on_enable_fn (Callable[[str]]) – The callback to be called when extension is enabled. It accepts extension id.
on_disable_fn (Callable[[str]], optional) – The callback to be called when extension is disabled. It accepts extension id.
ext_name (str, optional) – Extension name to look for. Hook is only called for extensions with matching name. Can be empty.
hook_name (str) – Hook name for debugging and logging.
- Returns:
Pair of hook holders.
- sync_registry( ) bool#
Synchronizes the extension registry.
- uninstall_extension(
- self: omni.ext._extensions.ExtensionManager,
- ext_id: str,
Uninstalls an extension from disk.
- unpublish_extension(
- self: omni.ext._extensions.ExtensionManager,
- ext_id: str,
- provider_name: str = '',
Removes a previously published extension from a provider.