Updated and tested with B2.58:
ValterVB has ported my python cookbook to the wiki format. It is now available at
I wish to thank Valter for his work.
The pdf version has also been modified. There is no reason to download the new file if you have the old one, because the only difference is that the license statement in the text has been removed. The code snippets are now licensed under Creative Commons, to comply with the wiki requirements. The new pdf file can be found at
All scripts have been updated for Blender 2.57 and work, or at least do not generate any errors, with the official release. New examples have been added in the following areas.
- Custom properties.
- Interface and operators.
- Blender add-ons.
- Multi-file packages
Update 2010.10.17: The examples in the original document from August do not work anymore, due to changes in Blender’s python API. A second edition, updated for Blender 2.54 and with many new examples, can be downloaded from
- The scripts work with Blender 2.54. More precisely, they have been tested with Blender 2.54.0 rev 32510, compiled from svn, on Ubuntu 10.04 64 bit.
- User interfaces (panels, buttons, properties, menus, polling).
- Simulations (cloth, softbodies, particle fire, smoke, rigid bodies, fluids).
Since the API is now supposed to have stabilized, there is a fair chance that most scripts will continue to work for the foreseeable future.
I have written a little text with small scripts examples in Blender 2.5x. The examples are not really usable (hence the word snippets), but illustrate how to access various features. All program do run in Blender 2.53.1 (at least on my computer), and there is a batch file which runs all examples in the text.
The pdf and python files can be downloaded from http://rapidshare.com/files/411523215/Code_snippets_Intro_to_scripting_in_Blender_25x_2010_08_07.zip.html .
(Update 2010.08.07. New download. Added missing image file and corrected some spelling errors.)
The focus is on data creation and manipulation. Here is a list of the topics covered:
- Vertex groups and shapekeys.
- Rigged mesh.
- Applying an array modifier.
- Three ways to construct objects.
- Multiple materials on a single mesh.
- UV texture.
- Object actions.
- Posebone actions.
- Editable hair.
- Camera and lights.
- Render settings and viewports.
- Batch run.
Some of the things that you will not find in these notes, at least not in the
- User interfaces, button layouts, etc.
- Macros, acting on what is currently selected.
- Nodes, for materials, compositing, etc.
- Game engine stuff.
- Brushes and sculpting.
- Advanced rendering, video compositing, …