IActionRegistry#

class omni.kit.actions.core.IActionRegistry#

Bases: pybind11_object

Maintains a collection of all registered actions and allows any extension to discover them.

Methods

__init__(*args, **kwargs)

deregister_action(*args, **kwargs)

Overloaded function.

deregister_all_actions_for_extension(self, ...)

"Deregister all actions that were registered by the specified extension.

execute_action(self, extension_id, ...)

Find and execute an action.

get_action(self, extension_id, action_id)

Get an action.

get_all_actions(self)

Get all registered actions.

get_all_actions_for_extension(self, extension_id)

Get all actions that were registered by the specified extension.

register_action(*args, **kwargs)

Overloaded function.

__init__(*args, **kwargs)#
deregister_action(*args, **kwargs)#

Overloaded function.

  1. deregister_action(self: omni.kit.actions.core._kit_actions_core.IActionRegistry, action: omni::kit::actions::core::IAction, invalidate: bool = True) -> None

    Deregister an action.

    Args:

    action: The action to deregister. invalidate: Should the action be invalidated so executing does nothing?

  2. deregister_action(self: omni.kit.actions.core._kit_actions_core.IActionRegistry, extension_id: str, action_id: str, invalidate: bool = True) -> omni::kit::actions::core::IAction

    Find and deregister an action.

    Args:

    extension_id: The id of the source extension that registered the action. action_id: Id of the action, unique to the extension that registered it. invalidate: Should the action be invalidated so executing does nothing?

    Return:

    The action if it exists and was deregistered, an empty object otherwise.

deregister_all_actions_for_extension(
self: omni.kit.actions.core._kit_actions_core.IActionRegistry,
extension_id: str,
invalidate: bool = True,
) None#

“Deregister all actions that were registered by the specified extension.

Parameters:
  • extension_id – The id of the source extension that registered the actions.

  • iinvalidate – Should the actions be invalidated so executing does nothing?

execute_action(
self: omni.kit.actions.core._kit_actions_core.IActionRegistry,
extension_id: str,
action_id: str,
*args,
**kwargs,
) object#

Find and execute an action.

Parameters:
  • extension_id – The id of the source extension that registered the action.

  • action_id – Id of the action, unique to the extension that registered it.

  • \*args – Variable length argument list which will be forwarded to execute.

  • **kwargs – Arbitrary keyword arguments that will be forwarded to execute.

Returns:

The result of executing the action, which is an arbitrary Python object that could be None (will also return None if the action was not found).

get_action(
self: omni.kit.actions.core._kit_actions_core.IActionRegistry,
extension_id: str,
action_id: str,
) omni::kit::actions::core::IAction#

Get an action.

Parameters:
  • extension_id – The id of the source extension that registered the action.

  • action_id – Id of the action, unique to the extension that registered it.

Returns:

The action if it exists, an empty object otherwise.

get_all_actions(
self: omni.kit.actions.core._kit_actions_core.IActionRegistry,
) List[omni::kit::actions::core::IAction]#

Get all registered actions.

Returns:

All registered actions.

get_all_actions_for_extension(
self: omni.kit.actions.core._kit_actions_core.IActionRegistry,
extension_id: str,
) List[omni::kit::actions::core::IAction]#

Get all actions that were registered by the specified extension.

Parameters:

extension_id – The id of the source extension that registered the actions.

Returns:

All actions that were registered by the specified extension.

register_action(*args, **kwargs)#

Overloaded function.

  1. register_action(self: omni.kit.actions.core._kit_actions_core.IActionRegistry, action: omni::kit::actions::core::IAction) -> None

    Register an action.

    Args:

    action: The action to register.

  2. register_action(self: omni.kit.actions.core._kit_actions_core.IActionRegistry, extension_id: str, action_id: str, python_object: object, display_name: str = ‘’, description: str = ‘’, icon_url: str = ‘’, tag: str = ‘’) -> omni::kit::actions::core::IAction

    Create and register an action.

    Args:

    extension_id: The id of the source extension registering the action. action_id: Id of the action, unique to the extension registering it. python_object: The Python object called when the action is executed. display_name: The name of the action for display purposes. description: A brief description of what the action does. icon_url: The URL of an image which represents the action. tag: Arbitrary tag used to group sets of related actions.

    Return:

    The action if it was created and registered, an empty object otherwise.