Posted by: Sanne | December 2, 2008

Python script: Sky Cube Wizard v0.2

This is a python command line script to rearrange the parts of the top half of a Blender environment map to make a square cube map, typically used in 3D scenes for skies and environments. This version 0.2 also supports sky cube maps from CGTextures as input files, which have a different layout as Blender env maps.

Download: skycubewizard v0.2
The script needs Python and the Python Imaging Library to run.

Blender Artists Thread: http://blenderartists.org/forum/showthread.php?t=142335

Details:

A Blender environment map has a layout like this for the top half of the scene:

test-env-390

The script rearranges it into this image:

test-env-390-cube

This is an image layout that is easily mapped to a half cube. Make a cube in Blender, cut it in half so that only the top half remains, mark the four vertical sides a seams, and unwrap it (Tab into edit mode -> AKEY to select all vertiecs -> UKEY -> Unwrap). The result should look like this:

uv-mapping-500

This UV layout can then be directly used for the cube maps from the wizard.

Since Blender tends to show seams at the vertical sides of the skycube when mapped to the edges of the image, the script automatically extends those sides by four pixels to prevent that. A different extend margin can be set by the -e command line option. The option -h shows a short help and further options.

Example usage:
python skycubewizard.py my-blender-envmap.png

Advertisement

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

Categories

Follow

Get every new post delivered to your Inbox.