Your First Blender Script
For this series I will present a script, walk through it line-by-line, display the results, and then include the full script. Import the libraries import bpy import math import mathutils import os Each of these statements imports one of the python scripts that are needed for what follows. bpy accesses all of the Blender libraries. math and mathutils provide access to a pair of math libraries. os is a wrapper for your operating system. Reset the environment bpy.ops.wm.read_factory_settings(use_empty=True) This statement sets the environment back to the "factory defaults" so that we can safely assume what the environmental settings are. Create the materials In Blender terminology, a material is an object which defines the color, reflectivity, etc. of an object and also selects the code which will be used for rendering these properties. The bits of code which do this are called shaders . Here we define a function that creates a single material object, bestows ...