ExtensionManager
- class omni.ext.ExtensionManager
Methods
__init__
(*args, **kwargs)add_path
(self, path, type)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.
fetch_extension_packages
(self, arg0)fetch_extension_versions
(self, arg0)get_change_event_stream
(self)get_enabled_extension_id
(self, ext_name)Get all python modules of enabled extensions
get_extension_dict
(self, ext_id)get_extension_id_by_module
(module)Get enabled extension id that contains this python module.
get_extension_packages
(self)get_extension_path
(self, ext_id)get_extension_path_by_module
(module)Get enabled extension path that contains this python module.
get_extensions
(self)get_folders
(self)Get folders monitored for python extensions.
get_hooks
(self)get_registry_extension_dict
(self, ext_id)get_registry_extensions
(self)get_registry_providers
(self)is_extension_enabled
(self, ext_name)pack_extension
(ext_id, output_folder)Pack extension into archive.
publish_extension
(self, ext_id[, ...])pull_extension
(self, ext_id)pull_extension_async
(self, ext_id)refresh_registry
(self)remove_path
(self, path)remove_path_protocol_provider
(self, scheme)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)uninstall_extension
(self, ext_id)unpublish_extension
(self, ext_id[, ...])- __init__(*args, **kwargs)
- add_path(self: omni.ext._extensions.ExtensionManager, path: str, type: omni.ext._extensions.ExtensionPathType = <ExtensionPathType.COLLECTION: 0>) None
- 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]) bool
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) bool
Add registry provider to be used for remote extension registry.
- Parameters
name (str) – Provider unique name.
provider (IRegistryProvider) – Provider.
- fetch_extension_packages(self: omni.ext._extensions.ExtensionManager, arg0: str) tuple
- fetch_extension_summaries(self: omni.ext._extensions.ExtensionManager) tuple
- fetch_extension_versions(self: omni.ext._extensions.ExtensionManager, arg0: str) tuple
- get_change_event_stream(self: omni.ext._extensions.ExtensionManager) carb::events::IEventStream
- get_enabled_extension_id(self: omni.ext._extensions.ExtensionManager, ext_name: str) str
- get_enabled_extension_module_names()
Get all python modules of enabled extensions
- get_extension_dict(self: omni.ext._extensions.ExtensionManager, ext_id: str) carb::dictionary::Item
- get_extension_id_by_module(module: str) str
Get enabled extension id that contains this python module.
- get_extension_packages(self: omni.ext._extensions.ExtensionManager) tuple
- get_extension_path(self: omni.ext._extensions.ExtensionManager, ext_id: str) str
- get_extension_path_by_module(module: str) str
Get enabled extension path that contains this python module.
- get_extensions(self: omni.ext._extensions.ExtensionManager) tuple
- get_folders(self: omni.ext._extensions.ExtensionManager) tuple
Get folders monitored for python extensions.
- Returns (List[Dict]):
List of folders. Each folder is dict with “path” and “builtin” key.
- get_hooks(self: omni.ext._extensions.ExtensionManager) omni::ext::IExtensionManagerHooks
- get_registry_extension_dict(self: omni.ext._extensions.ExtensionManager, ext_id: str) carb::dictionary::Item
- get_registry_extension_packages(self: omni.ext._extensions.ExtensionManager) tuple
- get_registry_extensions(self: omni.ext._extensions.ExtensionManager) tuple
- get_registry_providers(self: omni.ext._extensions.ExtensionManager) tuple
- is_extension_enabled(self: omni.ext._extensions.ExtensionManager, ext_name: str) bool
- pack_extension(ext_id: str, output_folder: str) 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
- publish_extension(self: omni.ext._extensions.ExtensionManager, ext_id: str, provider_name: str = '', allow_overwrite: bool = False) bool
- pull_extension(self: omni.ext._extensions.ExtensionManager, ext_id: str) bool
- pull_extension_async(self: omni.ext._extensions.ExtensionManager, ext_id: str) None
- refresh_registry(self: omni.ext._extensions.ExtensionManager) None
- remove_path(self: omni.ext._extensions.ExtensionManager, path: str) None
- remove_path_protocol_provider(self: omni.ext._extensions.ExtensionManager, scheme: str) None
- remove_registry_provider(self: omni.ext._extensions.ExtensionManager, name: str) None
Remove registry provider.
- Parameters
name (str) – Provider unique name.
- set_extension_enabled(self: omni.ext._extensions.ExtensionManager, extension_id: str, enabled: bool) None
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) 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]) None
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) tuple
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 = '') Tuple[omni::ext::IHookHolder, omni::ext::IHookHolder]
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(self: omni.ext._extensions.ExtensionManager) bool
- uninstall_extension(self: omni.ext._extensions.ExtensionManager, ext_id: str) bool
- unpublish_extension(self: omni.ext._extensions.ExtensionManager, ext_id: str, provider_name: str = '') bool