Part 2: Interactive Tools and Animation
This section explains how to write add-ons as folders rather than single files, interact with the animation system, and write modal operators that wait for user input. By the end of this section, you will be able to write advanced, interactive tools.
Chapter 6, Structuring Our Code and Add-Ons
This chapter explains how to write and distribute addons containing multiple files in a folder.
Here’s a summary of the topics discussed in the chapter.
The relationship between modules, packages, and add-ons
While a single .py
file is a Python module, a folder containing .py
files is a Python package. Packages contain a file named __init__.py
. If our package is an add-on, this file must contain the bl_info
dictionary.
Guidelines for partitioning code
Some criteria for separating the code through different .py
files are as follows:
- Media loaders
- Generic code versus specific code
- Interface code
- Operator modules...