Blender for Python Programmers

So you want to use Python to do stuff in Blender? Here are my notes as I go down the rabbit hole.

In Blender, Python is a tool for automating stuff you could do manually. The best way to get started is to learn how to do things manually and then once you have it figured out, make the Python script. Here is a great tutorial to get you started.

Official Docs

Make sure to checkout the “Gotcha’s” section.

Naming Stuff

From the “Gotcha’s” section: don’t name stuff:

Using PyCharm

So you want to use the PyCharm debugger on your Blender code? Here is how:

Running Python Blender Script Non-interactively

From the command line, enter:

blender --background --python

Writing Modular Code

First step is to configure Python paths. Pro-tip, when playing with Python paths, it is sometimes helpful to print them:

import sys


This page shows the layout of default paths. If you choose to put some *.py files in the ./scripts/modules, do not forget to put a file in there too.


import bpy



This is not so much a Blender thing, but more of a 3D modelling thing. There are lots of ways of specifying rotations. Each with it’s own pros and cons. One important way is with quaternions. I have studied a lot of math in my days, but somehow quaternions never came up. To make matters worse, the math behind them is non-trivial. Here is the best free, online tutorial I could find.

General Tutorials

The Proving Ground


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s