Writing the Shaker add-on
The Shaker add-on creates a shaky effect on the active object by adding noise modifiers to its animation curves.
There are cases when we want to add some shaking to a motion. For instance, directors often use a camera shake to suggest an object being bumped or hit. Another use case is the bumpy motion of a vehicle, or hairs and feathers in a windy environment. The Python script we are going to write will contain an operator and a menu function for quick execution.
Setting up the environment
We first create a Python script for our add-on:
- Create the
PythonScriptingBlender/ch8/addons
folder. We can use the file manager or the File tab of our code editor, such as VS Code. - Create a new file in that folder and name it
object_shaker.py
. We can use the file manager or the New File button of our code editor. - Open the file in your editor of choice.
- Set the Scripts path to
PythonScriptingBlender/ch8
in the Blender File Paths preferences...