IExtensionManagerHooks#

class omni.ext.IExtensionManagerHooks#

Bases: pybind11_object

Methods

__init__(*args, **kwargs)

create_extension_state_change_hook(self, fn, ...)

Create extension state change hook.

__init__(*args, **kwargs)#
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]]) – 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.