Synfig file python library and conversion to telegram animated stickers

Hi, I’ve been working on various script for the telegram animated sticker format.

For those who don’t know, this format is a zipped lottie file, I already had a synfig exporter based on the lottie export plugin (more info on that plugin here: GSOC-2019::Export Animation for Web).

Telegram has some pretty draconian restrictions on which features are allowed, so I decided to write my own parser/converter from synfig to stickers that ensures the output is supported.

While doing that I’m also building a small Python library to handle synfig files in a more convenient way than parsing XML directly. Maybe it can be useful to other people too. https://gitlab.com/mattia.basaglia/tgs/-/blob/sif_api/lib/tgs/parsers/sif/api.py

4 Likes

Very interesting! Thanks for sharing it!

I’ve implemented parsing for most of the synfig parsing.

However I’m struggling a bit in the conversion of group layer transformations linked to bones. Does anyone know what I need to do to get the resulting transformation based on the bone and the group origin / base transform. I can’t seem to get the position to line up correctly.

@blackwarthog Any advice here?

I’ve finished most of the work on this.

Probably I can clean up some things in the synfig file parsing API, but it should already be in a state where it allows to manipulate sif files in a convenient way.

The sticker exporter plugin is working, the only feature that I still haven’t figured to convert is the skeleton links, as explained in my previous post.

Probably the interface between synfig and its plugin could be improved, it was mentioned in other threads but I’ve written a better SVG parser than the one included with Synfig to it would be nice to have the ability to import from plugins.

1 Like

The Synfig plugin can be downloaded from here: http://mattia.basaglia.gitlab.io/tgs/downloads.html

2 Likes

Regarding synfig’s plugin system, I’ve made a pull request where export plugins are handled more nicely.

3 Likes

Thank you so much for contribution. I have already checked it. Awesome work!

Also maybe add readme.txt to download with information where to place the plugin?

I’ve added a README with a link to the wiki

3 Likes

Updated link - http://mattia.basaglia.gitlab.io/python-lottie/

Edit BobSynfig: New link Glax / python-lottie · GitLab