Retro Affect is an indie development team comprised of Kyle Pulver, David Carrigg, and Peter Jones. They have a very nice website where they do frequent blogs about the process of creating their current project, a game called Snapshot is a platform style game where you run around and interact with items in the environment by taking pictures. The game looks awesome, but isn't out yet. However, I've been following their progress for a while, and they do weekly blogs about the tools that they use for development.
One such tool, that they released to the web for everyone to use was their RA Animation Exporter script for adobe photoshop.
Follow the link and you can find out the details surrounding the script.
Some people who were downloading the script and attempting to use it were getting errors and when I downloaded it, I was getting the same errors. I attempted to hunt this down and was able to find that certain lines just needed to be included in a try/ catch block. I put those changes in place and the script ran, but images weren't showing up at all when the script was ran, I was just getting a blank 1X1 png image.
It took a little while of going through the code and using alerts, but I was able to find that the getFrame() function that the script used wasn't properly returning the number of frames for some reason, and as such the script had zero frames of animation to use. So, I changed this by prompting the user to enter the number of frames.
I then put in some changes to make the user specify a desired texture width and limited the sprite sheet size to a minimum of 16X16 and maximum of 4096X4096.
With that the script works fine for me. I should also mention however that the accompanying example that comes with the RA script never quite worked the way it should have for me. After messing with it a bit, I think it has to do with the positioning of the images on each animation layer. They are not centered in the image and instead move through out the image. Technically this shouldn't be a problem, so I'm not quite sure why all the frames don't show up using that .psd but have found that if I follow these limitations my version of the script works perfectly.
Canvas sizes must be in powers of 2. (The script actually checks for this and will exit if the canvas sizes aren't set correctly.)
It works best with square canvas sizes, meaning width and height are the same dimensions. 32X32 for example.(This isn't a requirement, but if for some reason you notice undesired results try adjusting your canvas to follow this caveat.)
Center your images on the canvas. This shouldn't be an issue as this is how most sprite sheets are laid out
If, when prompted, you put more or less frames then you actually need, the script is going to allocate for that many frames, so be sure you are accurate. Otherwise, the full animation won't be there, or you're just going to have a lot of empty cells.
You can download my version of the script either from the Retro Affect post at the bottom of the page or from
A big Thanks to Peter Jones from Retro Affect for making the script available in the first place. Before that script, I didn't even know it was possible to script photoshop, so, this introduced me to a whole new bad ass world. Also, thanks for hosting the script on the RA site, and good luck with Snapshot!