omni.ext module

class omni.ext.ExtensionManager

Bases: pybind11_builtins.pybind11_object

add_path(self: omni.ext._extensions.ExtensionManager, path: str, type: omni.ext._extensions.ExtensionPathType = ExtensionPathType.COLLECTION)None
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
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._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._dictionary.Item
get_extension_path(self: omni.ext._extensions.ExtensionManager, ext_id: str)str
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._dictionary.Item
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
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
refresh_registry(self: omni.ext._extensions.ExtensionManager)None
remove_path(self: omni.ext._extensions.ExtensionManager, path: 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.

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], None]) – The callback to be called when extension is enabled. It accepts extension id.

  • on_disable_fn (Callable[[str], None], 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.

unpublish_extension(self: omni.ext._extensions.ExtensionManager, ext_id: str, provider_name: str = '')bool
class omni.ext.ExtensionPathType(self: omni.ext._extensions.ExtensionPathType, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Index Refresh States.

Members:

COLLECTION

DIRECT_PATH

EXT_1_FOLDER

COLLECTION = ExtensionPathType.COLLECTION
DIRECT_PATH = ExtensionPathType.DIRECT_PATH
EXT_1_FOLDER = ExtensionPathType.EXT_1_FOLDER
property name

handle) -> str

Type

(self

class omni.ext.ExtensionStateChangeType(self: omni.ext._extensions.ExtensionStateChangeType, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Members:

BEFORE_EXTENSION_ENABLE

AFTER_EXTENSION_ENABLE

BEFORE_EXTENSION_DISABLE

AFTER_EXTENSION_DISABLE

COUNT

AFTER_EXTENSION_DISABLE = ExtensionStateChangeType.AFTER_EXTENSION_DISABLE
AFTER_EXTENSION_ENABLE = ExtensionStateChangeType.AFTER_EXTENSION_ENABLE
BEFORE_EXTENSION_DISABLE = ExtensionStateChangeType.BEFORE_EXTENSION_DISABLE
BEFORE_EXTENSION_ENABLE = ExtensionStateChangeType.BEFORE_EXTENSION_ENABLE
COUNT = ExtensionStateChangeType.COUNT
property name

handle) -> str

Type

(self

class omni.ext.ICppExt

Bases: pybind11_builtins.pybind11_object

shutdown(self: omni.ext._extensions.ICppExt)None
startup(self: omni.ext._extensions.ICppExt, arg0: str)None
class omni.ext.IExt(self: omni.ext._extensions.IExt)None

Bases: omni.ext._extensions.ICppExt

class omni.ext.IExtensionManagerHooks

Bases: pybind11_builtins.pybind11_object

create_extension_state_change_hook(self: omni.ext._extensions.IExtensionManagerHooks, fn: Callable[[str, omni.ext._extensions.ExtensionStateChangeType], None], type: omni.ext._extensions.ExtensionStateChangeType, ext_name: str = '', ext_dict_path: str = '', order: int = 0, hook_name: str = '') → omni.ext._extensions.IHookHolder

Create extension state change hook.

Hook is valid while returned hook holder object is alive.

Parameters
  • fn (Callable[[str, ExtensionStateChangeType], None]) – The callback to be called on extension state change event. It accepts extension id and type of hook event.

  • type (ExtensionStateChangeType) – Extension state change moment to hook into.

  • ext_name (str, optional) – Extension name to look for. Hook is only called for extensions with matching name. Can be empty.

  • ext_dict_path (str, optional) – Extension dictionary path to look for. Hook is only called if it is present.

  • order (int, optional) – Hook call order (if there are multiple).

  • hook_name (str) – Hook name for debugging and logging.

Returns

The hook holder.

class omni.ext.IExtensions

Bases: pybind11_builtins.pybind11_object

create_extension_manager(self: omni.ext._extensions.IExtensions, arg0: carb.events._events.IEventStream) → omni.ext._extensions.ExtensionManager
class omni.ext.IHookHolder

Bases: pybind11_builtins.pybind11_object

Hook holder.

class omni.ext.IRegistryProvider(self: omni.ext._extensions.IRegistryProvider)None

Bases: pybind11_builtins.pybind11_object

class omni.ext.IndexRefreshState(self: omni.ext._extensions.IndexRefreshState, arg0: int)None

Bases: pybind11_builtins.pybind11_object

Index Refresh States.

Members:

DOWNLOADING

DOWNLOAD_SUCCESS

DOWNLOAD_FAILURE

DOWNLOADING = IndexRefreshState.DOWNLOADING
DOWNLOAD_FAILURE = IndexRefreshState.DOWNLOAD_FAILURE
DOWNLOAD_SUCCESS = IndexRefreshState.DOWNLOAD_SUCCESS
property name

handle) -> str

Type

(self

omni.ext.acquire_ext_interface(plugin_name: str = None, library_path: str = None) → omni::ext::IExt
omni.ext.acquire_extensions_interface(plugin_name: str = None, library_path: str = None) → omni::ext::IExtensions
omni.ext.get_extensions_interface() → omni.ext._extensions.IExtensions

Returns cached omni.ext.IExtensions interface

omni.ext.release_ext_interface(arg0: omni::ext::IExt)None