How to Write a Python Script for Blender
Blender is a 3D animation application that can do 3D graphics, animation and games. It is currently an open source application. Python is a high-level programming language that is used for scripting and for developing stand-alone applications. Blender supports the use of python scripting for creating games and complex interactive animations.
Things You'll Need
- Plain text editor, such as Notepad or TextEdit
- 3-button mouse (recommended)
Instructions
-
-
1
Open a plain text editor. Examples of plain text editors are Notepad for Windows and TextEdit for Mac OS X. In order to ensure that TextEdit is in plain text mode, open "TextEdit" on the title bar, then "Preferences" and check "Plain Text" in the dialog box that comes up, if it is not already checked. Close out of the current text document and create a new one.
-
2
Write the python script in the plain text editor. The first line of the script must be "import Blender" without quotes. This loads the Blender module. The rest of the script will vary depending on what you are scripting. If you need an overview of the modules and functions included in the Blender module, open Blender, select "Help" from the title bar and select "Blender/Python API Scripting". Save your script. It should have the file extension ".py".
-
-
3
Click on the "i" icon on the top left of the Blender screen next to "File" and select "Scripts editor." This brings you to a screen that allows you to import your script. Load your python script.
-
1
References
- Photo Credit Ciaran Griffin/Lifesize/Getty Images