If you are a Python expert, you may want to skip this
chapter now.
As you already might know, Python is the scripting language used in
Blender to access objects and their data. You might want to use Python
when:
you want to visualize or animate using external data or input devices
you want to procedurally create or manipulate objects (meshes)
you want to write your own 3D format importer/exporter
Python is widely used in the scientific world, for more references and
also the official documentation see http://www.python.org
A python script inside Blender is normally invoked by the built in Text
editor, pressing the hotkey 'ALT-P'. Usually, the first line of the script
contains the following command:
import Blender
This loads the built in module 'Blender' which provides all the necessary
sub modules and functions to access Blender objects.
Because of historical reasons, there are two different modules providing
an interface to Blender. We recommend using the first one, the second one
is for now (as of Blender 2.14) kept for compatibility.
For more information on these two APIs see below.
'Old' and 'New' API
The terminology often used for the two APIs is:
'old' API: The Python API of version <2.04
'new' API: The API in version 2.10 - 2.12
Not enough of confusion, there is also an API specific to the GameEngine
with different commands. This appears quite chaotic which we want to apologize
for. For the reasons of all these different APIs see below
We are aware of the lack of documentation/tutorials at this moment because
of lacking manpower on one hand and the unfinished state of the Python
API on the other. But there are many example scripts demonstrating
features for download at
Several people have been working on the APIs. Somewhere in the meantime,
the API was completely redesigned, but forgotten, that a large part of
the user community was relying on a major collection of scripts in the
old API syntax. For the GameEngine, the syntax was designed for quick prototyping,
but not for conformity with either of the 'new' or 'old' API. We have recognized,
that this makes it hard to use for beginners, and we are working on a new
design.