sidebar features
sidebar content

Go Back   Blender Artists Forums > General Forums > Python & Plugins

Reply
 
Thread Tools
Sanne's Avatar
Sanne Sanne is offline
Member
 
Join Date: Apr 2006
Posts: 496
Hi all,

I made myself a python script that helps with sky cube images, maybe somebody finds it useful also.

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.

Details:

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



The script rearranges it into this image:



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:



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
#1   Old 02-Dec-08, 18:29   
Reply With Quote


bongox's Avatar
bongox bongox is offline
Member
 
Join Date: Nov 2005
Location: Canada
Posts: 138
wow looks really useful for game engine stuff. I'll give it a shot & let you know how it works for me. Thanks for sharing this dude!
#2   Old 04-Dec-08, 18:35   
Reply With Quote
Sanne's Avatar
Sanne Sanne is offline
Member
 
Join Date: Apr 2006
Posts: 496
Hey, great to have a tester, you're the first, thanks for giving it a go. I'd be very interested in hearing if it works for you. If you're not on Linux, I'd be double interested, as I didn't have a chance to test it on other systems yet.

Thanks for your interest!
............................................
Internet for Peace
#3   Old 04-Dec-08, 19:07   
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 22:58.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Blender Headlines
Featured Artwork
Short animation: Barrel by Phlopper
Woolly mammoth by sebastian_k
Photorealistic classic furniture by eMirage
Social BlenderArtists