Folders, packages, and add-ons
We know that an add-on consists of Python code accompanied by information for the Blender plugin system. While single-file Python scripts are called modules, a folder of scripts is called a package.
Writing an add-on folder implies that we will store the Blender information at the package level, so we will create a directory and create the package information first.
Creating a package folder and the init file
Let’s create a folder for this chapter in our Python project. Then, in the Blender Preferences area, set the ch6
folder as our Scripts Folder and restart Blender. To make a package, we need to create a new folder rather than a new file. We can do that using the file manager or, like in the following steps, use the files bar of our programmer editor:
- Select
PythonScriptingBlender/ch6/addons
. - Create a new folder by clicking the New Folder icon:
Figure 6.1: Creating folders in Visual Studio...