Accessing Blender modules
Blender’s additional modules are available throughout the application and can be used via the standard import
statement. They are available in the Python console, the Text Editor, and generally in the scripts that are installed in the Blender system and user paths.
Some modules are very specific; for instance, the freestyle
module handles the settings of the freestyle stylized rendering and cannot be used for any other purpose. Others, such as mathutils
, come into play whenever numbers are concerned.
Finally, the bpy
module and its submodules play a bigger role in Blender scripts, as they grant access to objects and data.
In this section, we will have a closer look at bpy
, how it is already present in the console, and how we can use it in our scripts. We will also learn where to find more information about the API and its elements.
The bpy module
In Chapter 1, we copied the lines from the console using Console->Copy from the Python...