Wrote a quick little add-on for the Ancient Beast folks that takes a rendered animation and creates a sprite sheet and/or an animated GIF based on the rendered frames.
A couple caveats:
The add-on assumes you’ve rendered a sequence of still images. It will not work if you’re rendering straight to a video file
The add-on also assumes that only the frames of your animation are in your render path. If other files are there, chances are good that you’ll get a pretty jacked-up sprite sheet
The add-on assumes that you have ImageMagick installed… specifically the montage tool. If you do not have ImageMagick installed, the script will likely vomit on you.
By default, if you enable this add-on, a sprite sheet and/or an animated GIF will be created automatically once your animation render job completes. Of course, there’s a Spritify panel in Render Properties where you can enable/disable this automatic feature and adjust a few other configuration options for your sprite sheet.
Wow, thanks!
I have just testet it and it saves a lot of time. No more manual stitching just a littlebit of camera animation. This thing ist just great for everyone who makes games.
So, i have worked with it a little more. For animated characters the row option seems to work fine. On the other hand i often deal with static sprites. These spritesheets grow over time. If i now add a frame to the “animation” the generated spritesheet gets reorganized and i have to edit the code to fix it in the game.
I have looked at the addon code and found a way to organize the spritesheet by columns. This way new sprites just get added at the bottom of the image and the order of the previous frames is still ok
Here is what i changed:
if scene.spritesheet.rows < 0:
tileSetting = str(abs(scene.spritesheet.rows)) + "x"
else:
tileSetting = "x" + str(scene.spritesheet.rows)
subprocess.call([
"montage",
scene.render.filepath + "*", #XXX Assumes the files in the render path are only for the rendered animation
"-tile", tileSetting,
"-geometry", str(scene.render.resolution_x) + "x" + str(scene.render.resolution_y) + "+0+0"
This way it works for me (ImageMagick 6.6.0-4 on Kubuntu). It is not a nice solution, but i failed at the interfacecode. Now i am just using a negative rowcount as collumsetting. Hope this helps.
Your rationale makes a lot of sense. And I think I have a slightly more elegant UI solution. I’ll make a boolean property to toggle between rows and columns. I’ll try to add that a little bit later today.
It’s a bit hard to read the text in your error message, so I’ll just ask here: Do you have ImageMagick installed? Are you rendering to a sequence of still images (not a video format)?
Ah. Understood. I should probably see if I can find a way to prevent sprites from being made if there’s no render. Unfortunately, Blender barely knows whether or not it’s rendered before. :S
Just a quick note. This script has been updated to work with API changes since 2.66. It should work now with 2.67b and the code that’s in trunk currently.
Apologies for such a basic question, but how do you get Blender and Imagemagick to talk to each other? I have IM installed (the Windows binary release), but Blender still won’t let me enable Spritify. I’m getting the “Requires Imagemagick” warning. Thanks.
ImageMagick binary needs to be in the executable path. I don’t have a readily-available Windows machine for testing (might need to fire up a VM, I guess :)), but it should be pretty easy to solve.