This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Will split a png cubemap/skymap image produced by blender into 6 separated image files for use in a skybox within unity | |
# Requires Python Imaging Library > http://www.pythonware.com/products/pil/ | |
# The author takes no responsibility for any damage this script might cause, | |
# feel free to use, change and or share this script. | |
# 2013-07, CanOfColliders, m@canofcolliders.com | |
from PIL import Image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# trys to cast strings into float or int if possible, or returns it. | |
def castToType(n): | |
n = n.replace(",", ".") | |
try: | |
num = float(n) | |
if "." not in n: | |
return int(num) | |
return num | |
except ValueError: | |
return n |