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. Let's get started 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. 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.