BlenderSpriter

enter image description here player

Update 2013-08-31: I’m making great progress on the GUI, and I have a good plan for simplifying the install process. Should be ready by September 7th. Follow @oversimplified #blenderspriter for updates!

Update 2013-09-07: Still working on the GUI, turns out running a Python script that tells Blender to run a Python script doesn’t work so well. Fortunately, you can add WXPython to Blender’s Python’s site-packages directory. Unfortunately, I had to use the WXPython Python 3 beta version (which isn’t really unfortunate at all). I posted a screenshot of my Blender site-packages directory down below. http://wiki.wxpython.org/ProjectPhoenix

Code

https://github.com/jkersey/BlenderSpriter

Description:

This script turns character animations into sprite sheets. For each .blend file in the blend_files directory with a camera set up to point at the target object, it will run through all of the animations and output the animation in the listed directions into a 1024×1024 .png file.

Setup:

site-packages   I’m running this with the 2.68a version of Blender and the included Python on Windows. I installed the Pillow image processing library in my installed version of Python3.3 and then copied the PIL and Pillow-2.1.0-py3.3.egg-info directories from the /Lib/site-packages directory to Blender’s python/lib/site-packages directory The config file has options for output path, anti-aliasing, and frame skipping What you’ll need to do in the .blend file: * Create an empty object called “Grip” * Set Grip as the parent of your camera * Set Grip as the parent of all lamps * Make sure the camera is set to Orthographic * Position the camera so that the entire object is visible and is as close to the edge as possible (accounting for animations) * Check the included player.blend file for examples Running:

c:/Program Files/Blender Foundation/Blender/blender.exe --background --python RenderScript.py" There is an ant script and .sh script included as well I also had to do this: set PYTHONPATH=%PYTHONPATH%;. To get it to see the Stitcher.py file.

Output

Output directory contains an images directory for the sprite sheets and a js directory for the JSON files with the animation lists.

Known Issues:

[ ] It only lets you fill one 1024×1024 page per .blend file (Windows) I tried using an external version of Python 3.3, but I got the cannot import name: MAXREPEAT exception and couldn’t get past it.

Further Reading:

http://www.blender.org/documentation/blender_python_api_2_61_0/info_tips_and_tricks.html

9 Responses to “BlenderSpriter”

  1. BlenderSpriter | BlenderNation Says:

    […] BlenderSpriter […]

  2. Becognize Says:

    Very nice. Will definitely try to incorporate your script into my workflow on my new project.
    GUI would be VERY nice. (Actually it would be a killer tool. Get that GUI done and i bet it ll have great success)

  3. James Kersey Says:

    Thanks! I’m trying to decide between trying to make it work in the Blender UI or build something in WXPython…

  4. Tadd Mencer Says:

    HAH funny enough I was working on using Blender to make my animations and sprite sheets. I’m really going to watch this project and I’ll be playing with it some this weekend!

  5. James Kersey Says:

    Awesome! Let me know if you have any trouble, I’m excited to see how this works in the real world :)

  6. Achi Says:

    Just last weekend I went to my first game jam. It would be massively helpful if it can work on Windows so we can create a good sprite sheet. Will stalk this massively!

  7. Moritz Says:

    Can you make please a tutorial video how to install and use it? :)

  8. James Kersey Says:

    Thats a really good idea :) Let me finish up the GUI, I think I can fix a lot of this installation mess at the same time.

  9. Moritz Says:

    Ok :) I will wating for the tutorial! :)

Leave a Reply