Skip to main content

Introduction

Anchorpoint has a Python API and a CLI that allow you to build integrations to other applications and to extend Anchorpoint with custom commands. The API is part of the Anchorpoint Action System. Building an Action in Anchorpoint is like building a plugin or an integration.

Use cases

  • Add custom buttons and context menu entries to the Anchorpoint UI
  • Build custom dialogs where the user can enter data and e.g., execute a command. This can be a publisher tool, a batch rename UI, or a file converter
  • Integrate with a game engine or DCC using the Anchorpoint CLI to control file locks or submit Git commands
  • Read metadata from Anchorpoint that you use for asset management
  • Integrate with project management or any other web tools and fetch data from them
  • Build project templates

Example Actions

You can find a number of action examples on our GitHub page, which you can download and configure. The following examples are included:

How to build an Action

Adding a button or a context menu entry

Extending the UI always requires a YAML configuration file that defines things like the name of the Action, a description that will be visible as a tooltip, and the registration type. This can be something like the sidebar, file/folder context menu, or an entry in the project settings. The logic of the Action will be defined in a Python file that will be linked to the YAML configuration.

These two files can be placed inside your project folder in the hidden .ap/actions folder. You have to create an empty actions folder if it does not exist yet. The structure will look like this:

project folder
|--.ap/
| |--actions/
| | |--toast_example.yaml
| | |--toast_example.py

Download this example and unzip it in your .ap subfolder in your project. You might need to restart Anchorpoint to see the sidebar button appearing.

version "1.0"
action:
name: "Show Toast" 
id: "toast"
type: python
script: "toast_example.py"

register:
sidebar:
enable: true

The toast_example.yaml file will add a button to the left sidebar. It will trigger the Python file that contains the logic.

import anchorpoint
ui = anchorpoint.UI()
ui.show_info("This is a toast example")

The toast_example.py file will show a toast (a message) to the user

The end result is a button that is registered in the left sidebar. Clicking the button will show a toast message.

Using the CLI

When you want to build an integration from another desktop application, the CLI will be the most convenient way. The CLI can also execute custom Python scripts that can e.g., access Anchorpoint metadata. The executable is located here:

  • Windows: C:\Users\ [username]\AppData\Roaming\Anchorpoint Software\Anchorpoint\app\ap.exe
  • macOS: /Applications/Anchorpoint.app/Contents/Frameworks/ap
`ap --cwd "C:\Repositories\myGameProject" status`

This command will return a Git status with additional information about locked files. The --cwd parameter defines the current project location. To get a list of all commands, type in ap -h or consult the CLI documentation.

The Anchorpoint Python interpreter

For autocomplete and proper syntax highlighting, it is recommended to use the Anchorpoint Python interpreter over the built-in one. It understands the Anchorpoint-specific Python modules.

On Windows, it can be accessed at C:\Users\[USERNAME]\AppData\Local\Anchorpoint\python.exe

Managing Actions across projects and sharing them with your team

A better way than putting Actions into the project folder is to put them in a central location that can be accessed by every user and is project independent. You can also use a public Git repository on GitHub. At the moment, it has to be a public GitHub repository or a shared folder on e.g., a NAS.

The benefit of using this method is that you can also bundle Actions packages. A package allows you to add dedicated Action settings and to enable/disable the Action workspace-wide.

The repository URL has to be linked in your Workspace Settings/Actions and this setting will be applied for every user in your team.

By default, Anchorpoint adds the Anchorpoint action repository from GitHub to every workspace. To adjust what actions are enabled in your workspace or to modify the repositories, open the action settings dialog.
You can find the settings for the action distribution in the action settings of your workspace.

Developer support

A great way to interact with the team is to use our Discord server. Organization license customers can also receive their own private channel at a certain license count.