omni.kit.actions.core¶
User Guide¶
API Reference¶
-
class
omni.kit.actions.core.
Action
¶ Bases:
pybind11_builtins.pybind11_object
-
property
description
¶ Get the description of this action.
- Returns
The description of this action.
-
property
display_name
¶ Get the display name of this action.
- Returns
The display name of this action.
-
execute
(self: omni.kit.actions.core._kit_actions_core.Action, *args, **kwargs) → object¶ Execute the action.
- Parameters
*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.
-
property
extension_id
¶ Get the id of the source extension which registered this action.
- Returns
The id of the source extension which registered this action.
-
property
icon_url
¶ Get the URL of the icon used to represent this action.
- Returns
The URL of the icon used to represent this action.
-
property
id
¶ Get the id of this action, unique to the extension that registered it.
- Returns
The id of this action, unique to the extension that registered it.
-
invalidate
(self: omni.kit.actions.core._kit_actions_core.Action) → None¶ Invalidate this action so that executing it will not do anything. This can be called if it is no longer safe to execute the action, and by default is called when deregistering an action (optional).
-
property
tag
¶ Get the tag that this action is grouped with.
- Returns
The tag that this action is grouped with.
-
property
-
class
omni.kit.actions.core.
IActionRegistry
¶ Bases:
pybind11_builtins.pybind11_object
-
deregister_action
(*args, **kwargs)¶ Overloaded function.
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?
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 action.
- 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.
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.
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.
-
-
omni.kit.actions.core.
acquire_action_registry
(plugin_name: str = None, library_path: str = None) → omni.kit.actions.core._kit_actions_core.IActionRegistry¶
-
omni.kit.actions.core.
execute_action
(extension_id: str, action_id: str, *args, **kwargs)¶ 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).
-
omni.kit.actions.core.
get_action_registry
() → omni.kit.actions.core._kit_actions_core.IActionRegistry¶ Get the action registry.
- Returns
ActionRegistry object which implements the IActionRegistry interface.
-
omni.kit.actions.core.
release_action_registry
(arg0: omni.kit.actions.core._kit_actions_core.IActionRegistry) → None¶