Script - Blender spriter

Ici on parle des scripts

Modérateurs : frez, Yadoob, stilobique, Matpi, ModSquad

Script - Blender spriter

Message par rls » 30 Août 2013, 07:10

James Kersey a publié son script générateur de sprite depuis une animation réalisée dans Blender.
C'est très pratique pour le jeux vidéo 2D. Cela évitera de devoir passer par un sprite builder qui fait le même boulot depuis une suite d'image.

Image

La description du script par l'auteur :
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:

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:

The output goes into the output directory, split into 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.


Le [urlhttps://github.com/jkersey/BlenderSpriter]code source[/url] et la page de doc officielle
[url]http://rls.artstation.com[/url]
Avatar de l’utilisateur
rls
 
Message(s) : 349
Inscription : 04 Août 2013, 07:34
Localisation : France, Bretagne

Retour vers Scripts - Python - OSL

Qui est en ligne ?

Utilisateur(s) parcourant ce forum : Aucun utilisateur inscrit et 2 invité(s)