Python Scripts
for Blender


Doo-Sabin Subdivision doosabin.zip
This script is a working implementation of doo-sabin subdivision. The mesh is converted to a topology/geometry representation (raw verts and faces lists), the subdivided mesh is stored in raw format, and converted back to indexed format at the end. It's not very fast, but it works.

Shortcuts: NumPad Plus Key - Increase the resolution in realtime;
NumPad Minus Key - Decrease the resolution in realtime

Install it in your Blender/.blender/scripts directory, then find it under the Add menu in the Scripts Window. More help, info, and key shortcuts are documented under Help->Scripts Help Browser->Mesh->Doo-Sabin Subdivision.


Geodesic Dome Generator geodome-teapot.zip
This script generates standard geodesic domes similar to Blender's IcoSphere, but adds the following features: resolutions higher than 5; two subdivision algorithms; spherize/keep-flat or full/half-dome options; and 3 geodesic bases. It outputs meshes with no duplicate vertices and is fully interactive.

It's basically a clone of my geodome plugin for Wings, and is written entirely in Erlang style: no for loops, no global variables, use of recursive functions, use of list comprehensions, etc. It can be used to compare the Python and Erlang programming languages, since most of the functions and variable names are identical.

Install it in your Blender/.blender/scripts directory, then find it under the Add menu in the Scripts Window. More help, info, and key shortcuts are documented under Help->Scripts Help Browser->Add->Geodesic Dome Generator.


Newell Teapot Generator geodome-teapot.zip
This script adds a famous missing primitive: the Newell Teapot. Most modelers have had this primitive for years, and now so does Blender. Includes several other bezier models including Yoda!

Install it in your Blender/.blender/scripts directory, then find it under the Add menu in the Scripts Window. More help, info, and key shortcuts are documented under Help->Scripts Help Browser->Add->Newell Teapot Generator.


Import-Export Suite IO-Menu.zip (for v2.32)
This suite of Python modules enables Blender to read and write ten 3D file formats. It allows radiosity solutions to be exported to trueSpace, Wings3D, VideoScape, Nendo, and LightWave.

It was formerly called the Radiosity Import Export Suite mainly because it was developed to import/export vertex-colored meshes using my own custom file format (*.radio), and because I wanted to know how vertex colors and meshes were stored. But now UV support and other formats have been added (see the table below).

Includes some nice sample objects IO-Examples.zip to get you started: cornell-box.radio, hand.radio, plane.radio, sphere.radio, torus-knot.radio, and lumpy-torus.radio.

Format

I/O

UV

VCOL

Application

*.mesh

R/W

R/W

_

LightFlow

*.ndo

R/W

_

W

Nendo

*.cob

R/W

R/W

W

trueSpace

*.scn

R

R

_

trueSpace

*.obj

W

_

_

VideoScape

*.radio

R/W

_

R/W

Radio

*.lwo

R/W

W

W

LightWave

*.raw

R/W

_

_

Raw Triangle

*.off

R/W

_

_

DEC Object

*.wings

R/W

_

W

Wings3D

For Blender 2.28
Extract IO-Suite2.zip to a directory on your pythonpath (or your BlenderDir), then run the contents of IO-Suite1.zip to import or export. Most of the new work is in the lightwave module (matererial indices, vertex colors, materials, specular highlights, etc.).


Backface Culling Script backface.zip
This script operates on the selected mesh and removes all polygons which are facing away from the camera (backface culling). It actually results in a 20% to 50% reduction in rendering time! It can also be used to perform 'hidden line removal' for cleaner wireframe renderings. (It may not always work properly for every situation, but I have successfully used it on objects with over 122,000 faces.) Let me know if you find it useful.


Displacement Mapping Suite displace.zip | displace-tutorial.zip
Displacement mapping uses a greyscale image to create an actual raised surface by modifying (displacing) the vertices. Bump mapping creates the illusion of a raised surface by modifying the vertex normals. A black pixel results in no displacement or bump, white results in full displacement or bump, and grey values are in between.

The good news is that, in addition to bump mapping, Blender supports displacement mapping (see the Tutor Guide #1). The bad news is that it only works for grids or subdivided planes. This feature, called planar displacement mapping, is great for making terrains, mountains, and even bathroom tiles.

However, if you want to displace the surface of a sphere, cylinder, or torus, Blender's current method will not be sufficient. To get around this, I have created several python scripts that enable Blender to support Spherical, Cylindrical, and Toroidal Displacement Mapping.

You can also download a more complete tutorial that shows how to create a volley ball.


UV Torus Suite uv-torus.blend
UV Torus Suite is a GUI python script that generates three types of tori with UV coordinates and Vertex Colors. It can create a standard torus (just like SurfDonut) and two variations (just like those included with LightFlow). It allows the user to specify the U/V resolution and a major/minor radius. For the two variations, a loop and loop radius can also be specified. This script is designed to be used with hotkeys and is fully interactive. It also comes with some rather extensive documentation, and a quick tutorial. When it comes to making tori, you can't go wrong with UV Torus Suite!


Wavefront OBJ Export Script OFF-OBJ-export.zip
This simple script writes the currently selected mesh to a Wavefront OBJ file. The archive also includes a DEC OFF export script. The OFF format is almost identical to Wavefront's OBJ. I wrote this one so I could get my huge meshes into Moonlight Atelier. (DXF can also be used but the file size is five times larger than OFF!) Blender/Moonlight users might find this script to be very useful.


This page was last revised on Monday, March 22, 2004
Copyright © 2001-2004 Anthony D'Agostino
All rights reserved.