SkyBox Script - Possible?

Hi, I hardly venture out of the game engine forums anymore, but I’ve been trying to start up a few things to simplify the process of creating games in blender. One is the creation of the mudane skybox. Basically the procedure is very easy, generate all 6 pictures for sides of a skybox cube all in terragen. Load all those pictures and map it onto the corresponding sides of the cube, invert the normals to the cube and viloa.

However, doing all this manually takes time and it’s a nuisance to do it all the time for each different skybox.

Here’s my question. I’m entirely new to this side of python scripting outside of the GE.

  • Is it possible to load all 6 skybox textures generated in terragen to blender?
  • Map each texture to each of the corresponding 6 faces of the cube?
  • Further, define the dimensions of the picture (say a 512x512 picture), remap the vertices of the cube in the UV window to just points ([1,1],[1,511],[511,511],[511,1]). This is because when doing a skybox for the GE, it has really bad seams unless I manipulate the UV points in this way.
  • Invert the normals of the faces of the cube, inwardsWell if someone already has written a script like this, :)perfect. If not, can someone please point me in the right direction? Thank you.

Thanks to the help from #blendercoders, I was able to put the stuff together. You can find it here,

Note: You have to download the divX plugin to see the video tutorial though.

Jason Lin

very possible and Im not sure anyones done exactly this. would be a good script for a beginner :wink:

:DAh that’s good, at least it’s possible.

But do you know where I can find out information for 2, 3, and 4? The blender python docs doesn’t seem to have anything on mapping uv images to faces in code. Or I may be mistaken, seeing as how I’m new to it all. Can you point me in the right areas to look?

Jason Lin

I’d like to try writing this, could you give me sample images to work from?

:DOh, I forgot to update.

After some help on #blendercoders on IRC. I was able to fill in the blanks and write the whole script. It works pretty well now. I just have to find some time to release it after I write the tutorial for creation of skyboxes and how to setup to use the script automatically in blender.

But thanks for the offer.

It kinda looks something like this now. I might add a few more parameters to make it more versatile for loading different skybox picture names, etc.

Jason Lin

Cool! that looks great!

Oops, sorry guys. I had finished it a long while back and forgot to update this thread with the link.

Look at the first post. It’s updated with the link.

Jason Lin