Level One Magic
"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke

Game Texturing Tools

These were developed to speed up the process of creating diffuse, normal, specular and glow maps with Photoshop, and implementing them in Maya.

createTextureTemplate.js (code)
This is a JavaScript file that can be placed in the folder: ./Program Files/Adobe/Photoshop/Presets/Scripts
Once there, it provides a new menu option in Photoshop under File > Scripts called createTextureTemplate, which can be run to create a new Photoshop document. The new document is 1024x1024 and contains layer sets and initial black layers for Diffuse, Specular, Height and Glow.

exportTexturePieces.js (code)
This is a JavaScript file that can be placed in the folder: ./Program Files/Adobe/Photoshop/Presets/Scripts
Once there, it provides a new menu option in Photoshop under File > Scripts called exportTexturePieces, which can be run to export PNG images for each of the layer sets created with the createTextureTemplate script. I find it quite handy to map to a hot-key. The files that are saved out are saved in the same folder as the PSD, at the same size as the PSD, and with the same name, including a suffix to indicate which of the files it is (_col, _spc, _nml, _bmp, _glo).

shader.py (code)
This is a Python library that can be used to quickly create a shading network that utilizes the files created from the exportTexturePieces script above. Place this in the folder: ./maya/scripts
Once there, execute the following code. You can then browse to the PSD source file, and a shading network will be created using the appropriate PNGs for color, specular, normal and glow. It is recommended to put the following code on a shelf button for ease of use.

import maya.cmds as cmds
import shader
pp = cmds.workspace(q=True, rd=True)
ip = cmds.workspace('sourceImages', q=True, fre=True)
path = cmds.fileDialog2(dir=pp + ip, fm=1, okc='Select', ff='PSD (*.psd)')
if path:
    shader.createGameShadingNetwork(path)[0]

Back to Main

© 2003-2013 Andrew Kelts