Writing the Vert Runner add-on
In this section, we will write an add-on that animates the selected objects along the geometry of the active object. The animation will trace a path that connects the vertices of a mesh, hence the name Vert Runner:
Figure 7.16: Animating a toy along the vertices of a path
This can be a basis for procedural walks or patrols, motion effects, or any other case where we have a geometrical path.
In this operator, the selected objects and the active ones are treated differently: the active object is the reference geometry on which the selected objects are moved.
Setting the environment
Let’s start by adding a new script to our add-ons directory:
- Select
PythonScriptingBlender/ch7/addons
in VS Code. - Create a new file by clicking on the New File icon.
- Name the new file
vert_runner.py
. - Open the file by double-clicking it.
As usual, we will start with the add-on information.