New extensions for layer-based animations

Discussion about writing code for Inkscape.
lordalexg
Posts: 1
Joined: Fri Aug 09, 2013 2:57 pm

New extensions for layer-based animations

Postby lordalexg » Fri Aug 09, 2013 3:18 pm

Hello. I'm new here, so some introduction: I'm in the process of learning some sprite animation for a game I'm (trying) to make, but I'm not good for pixel art or 3d modeling, so I decided to use inkscape because I was already familiar with it.

Here I upload two extensions, both will appear in the menu Extensions -> Animation (layer-based).

1. Export Layers as Separate Files
This one will export each layer not hidden (unless you tick "Include hidden") to a separate .png file. You can use sub-layers to group different animations.

Example: I created an svg file with the following layers:
front
- 1
- 2
- 3
side
- 1
- 2
- 3
This extension will generate the files:
basename_front_1.png
basename_front_2.png
basename_front_3.png
basename_side_1.png
basename_side_2.png
basename_side_3.png

2. Export Layers to Sprite Sheet
This one is the most interesting: it will generate directly an spritesheet with each layer as a frame. Also will create a file named basename.txt with frames (=layers) coordinates in pixels.

Example spritesheet:
Image

Instalation:
The extension are written in python an should work in any platform. Just copy the files inside the .zip into the extensions directory.

Feedback and suggestions are welcome.
Attachments
ILBAEv0.1.zip
extensions files
(4.43 KiB) Downloaded 485 times

snotclot
Posts: 2
Joined: Tue Aug 20, 2013 4:14 pm

Re: New extensions for layer-based animations

Postby snotclot » Tue Aug 20, 2013 4:17 pm

Hey, thanks for this is a great plugin! I just tried it using the 2nd option: sprite sheet, using 2 layers for testing.

One question though: we cannot enter in the # of columns - how did you generate the grid in your example above? Does it automatically calculate the # of columns once you have too many layers, and convert it to a grid?

Thanks!

snotclot
Posts: 2
Joined: Tue Aug 20, 2013 4:14 pm

Re: New extensions for layer-based animations

Postby snotclot » Thu Aug 29, 2013 7:39 am

Ok shortly after this post, I tried it out for myself. I think it takes the # of layers you have, and sqrts to roughly get a square sheet.

Great mod. Thanks again.

Would also be nice if, instead of taking the entire image of each layer, we could select multiple selections and have each selection turn into a sprite in the sprite sheet.


Return to “Programming”