Sprite Render Script

A MaxScript utility for rendering sprites and exporting data.
 

Download: Version 0.6


See the Readme for features.
    * New in version 0.7:
  • rigorously debugged
  • made a complete feature list
  • wrote instructions, you can launch the readme.html from the script
  • render lists export to XML
  • added tga format
I'm continuously updating the script and I'm open to suggestions or comments from anyone that uses it.

My sprite render script will render animations and pack them into a sprite sheet. It can export a heightmap along with the image to use for normal-mapped sprites. It exports the image file, (and optionally the heightmap) and the animation frame data as an XML file. It can save the settings of an entire sheet to automate the process of rendering a sheet without entering the settings again.

You can create "Sprite Points" (point helpers with a custom attribute), attach them to anything in your scene, and the positions of the points will be stored for each frame rendered. You can use this animation data in your game to attach different 'parts' to a sprite, allowing for complex and dynamic sprite compositions. The points' positions are raycast into frame coordinates and stored with the animation data in the exported file.

This character was rendered into four parts: torso, left arm, right arm, and legs. The torso was rendered with three Sprite Points attached, one at each shoulder, and one at the waist. The animated positions of the "joints" are exported with the data so the game can attach the arms and legs on the fly. This allows sprites to be built with pieces that can change animations separately. They can also have interchangeable parts, so you can create endless variations. (Note: the shoulder appears to dislocate in the gif, but this was my mistake while linking the sprite points, not the fault of the script.)

There is an option to save the heightmap along with the exported image. You can take this heightmap and use the Nvidia Photoshop plug-in top generate a normal map. CrazyBump is a nice normal map generator, if you have $100.