Planetside Software Forums

General => File Sharing => Tools, Utilities => Topic started by: Kevin Kipper on August 22, 2025, 12:19:32 AM

Title: Script: tg_cubemap_image_stitcher.py
Post by: Kevin Kipper on August 22, 2025, 12:19:32 AM
Cubemap texture images come in a variety of layouts.  It seems like each 3D application has its own preference for the order and rotation of the individual images making up the texture.  Is it a horizontal cross or a vertical one?  Is the order left, front, right, back, up, down, or something else entirely?  And what about flipping or rotating an image to align a particular edge?

Well no matter what the alignment or order, we're happy to share this Python script with you that will stitch together the six cubemap images into a single cubemap texture image, however you want.

The tg_cubemap_image_stitcher.py script is part of the Redmaw TG Toolkit.  The script doesn't require Terragen to run, but you'll need the Python program and a few modules as outlined in the toolkit's documentation.

Blog_Cubemaps_20_UI-stitcher.jpg

To stitch your images together simply run the script and navigate to the folder containing the cubemap image sequence and select one of the frames; it doesn't matter which one.  The script will attempt to load the first file that matches the aliases for each "cube face".  Then it's just a matter of selecting your preferred layout and assigning an image to it.  You can even use the presets to automatically arrange the images.  You can preview and then save the cubemap texture image.

We've created a Support Diaries: Cubemap (https://planetside.co.uk/blog/support-diaries-cubemaps/) blog post that goes into more detail about creating cubemaps.

Click the link below for download and installation information for the entire toolkit.
https://github.com/RedMawVFX/redmaw-tg-toolkit (https://github.com/RedMawVFX/redmaw-tg-toolkit)

Or, click the link below to go directly to the tg-cubemap-image-stitcher folder in the toolkit.
https://github.com/RedMawVFX/redmaw-tg-toolkit/tree/main/scripts/tg-cubemap-image-stitcher (https://github.com/RedMawVFX/redmaw-tg-toolkit/tree/main/scripts/tg-cubemap-image-stitcher)