Actions

Version 2.2 introduced action hooks, enabling custom buttons that trigger Python scripts. These actions can run on collections to add elements to external DCCs, review software or similar tasks.
The actions are Python scripts that trigger any custom operation for one or more elements. Actions can also be triggered for all items in a collection.

Action scripts will be placed in the same folder as other hook files ($DASELEMENT_HOOKS or $DASELEMENT_RESOURCES/scripts/hooks). Learn more about hooks here: Hooks
A action script must follow this pattern: action_{name}.py
For example:
action_foo.pyaction_bar.pyaction_custom-action.py
Download example action hook: https://github.com/das-element/resources/blob/main/scripts/hooks/examples/actions/action_my-custom-action.py
Customize button
In the script add a variable called: METADATA to further customize the action in the UI.
METADATA = {
'name': 'My Action',
'description': 'A custom action to process selected items',
'icon': '/path/to/icon.png',
'color': "#182a3b",
'order': 2
}
key | function |
|---|---|
| Name of the action, displayed as the button text |
| Help text that’s shown when hovering over the button |
| custom icon of the button (file path or URL) |
| custom color of the button |
| defines the order in which the buttons are displayed in the UI |