bulia byak wrote:
On 6/5/06, Matt Jordan <matt@...1296...> wrote:
do more-or-less traditional, cel style animation. One tedious bit, though, is the outputting of the individual png frames. Would it be possible to write a script or a plug-in that would do that as a batch? So, you'd have background layer plus layer 1 output as 000000.png, background plus layer 2 as 000001.png, and so on? If so, where would I go to learn how to write such a script or plug-in?
Yes, it's easy to do. For example I use a shell script with:
for i in `range /${2}..${3}/`; \ do inkscape --export-png=${1}-${i}.png --export-id=${i} \ --export-id-only --export-dpi=400 --export-area-canvas \ --export-background-opacity=1 ${1}.svg; done
Here, the first script parameter, ${1}, is the name of source SVG without extension, ${2} is the number of starting layer to export, and ${3} is the final layer. Layer names must be numbers with the same number of digits, for example 001, 002, ... 010, ... etc. You can make an empty template with all these layers already added. Then call this script "ex" and call it:
$ ex filename 001 033
and it will export layers from 001 to 033 into filename-001.png, filename-002.png, etc.
For this to work you will need the "range" utility available here: http://suso.suso.org/programs/num-utils
The only problem is that you need to have all your layers to be unhidden before you call this. I plan to add another command line switch to force unhiding of the exported object even if it is hidden in SVG, so manual unhiding in Inkscape will not be needed.
Thanks for the help. I'm on Ubuntu Linux now and I'll try to play with this suggestion some this weekend.
Cheers,
Matt Jordan