You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reacted by Adam Piskorski, Konstantin Dmitriev, WPFilmmaker, Ankit Kumar Dwivedi, Anish Gulati, Jan Jurzitza, Robin van der Vliet, Marcelo Madeira, elf Pavlik, Losses Don and 6 more
I think this would be a killer feature, as otherwise to have a nice modern pipeline for animations on web + mobile you would need Adobe AE.
Synfig could certainly reduce the barrier to entry and keep the pipeline in the open source world.
I support this move too. This would be very useful to have in synfig as also the web community Is large and svg-based animation on the web is growing. The thought of Having to use a great tool like synfig to make animations for the web makes me happy.
May I ask, What are the core requirements that could make this happen.
This would mean writing a Python converter that parses XML into structured JSON. Lottie uses JSON and uses a Javascript interface so it's works well for the web.
Hi,
I am Anish from IIIT Hyderabad. I would like to contribute to this project in GSOC. I was going through the idea list and this seems interesting. Could anyone help me get started with this?
@dinolinjob@AnishGG welcome to the tread! I suggest to start by implementing a demo plugin that does some very simple conversion. I.e. converts some Synfig file with one simple layer (Rectangle or Circle or Image) to Lottie JSON.
@dinolinjob@AnishGG@ThobyV Before starting, please let me know which simple layer you choose to implement - so we make sure each one is taking different task. ^__^
@morevnaproject I am interested either. I'll go with the circle layer Synfig file. I will make sure to update you here. Most of my stuff is on Gitlab with id prasadPVR.
@mbasaglia can you give an example output file so I can test if my Telegram picks it up independently? Also would you be able to create a command line tool just to convert Lottie JSON to tgs? I think that would be really helpful to get other people up to speed.
@LaPingvino
Here's a test file (Note: I had to add the gz suffix to upload it to github, for telegram remove ".gz" from the file name, without extracting it) test.sifz.D35E47A0.tgs.gz
Also keep in mind currently the Lottie exporter is very basic so it can't yet be used to export anything but the most trivial shapes and animations.
I already have utility scripts in the same repo I've linked above. I'm also working on a python library based off the Lottie json schema
Quick question: What kind of reference/documentation has been used to describe the lottie format for exporting from synfig? I see some discrepancies between the json schema in the lottie repo and the output from the synfig plugin.
The schema itself seems a bit low quality so I was wondering if there was a better source of info on the format.
Basically the above mentioned JSoN schema has been used. The keys which are serving no purpose have been removed intentionally. Even the schema has some mistakes in it.
So to be fully sure, you can create the shape/layer in After Effects and use bodymovin plugin to export it to lottie format. This will give you the correct results.
@mbasaglia
I had a look at the tgs code on gitlab. I noticed that you cloned the lottie-exporter's part which is merged in the master. It does not support splines yet.
But the lattest version #756 supports splines. You might want to clone this instead of the previous version
btw, I did a lot of work on making sense of the lottie format so I developed a python framework that can be used to read and write these files. If there's ever the need to import lottie files into synfig my framework is capable of doing so.
Reacted by Konstantin Dmitriev and Anish Gulati
Reacted by Anish Gulati and Mohammad-Mohsen Aseman-Manzar
I've picked up Synfig and have been trying out the lottie exporter, and I've found that it fails on this file: noises_graithtiger.zip, giving the error:
Traceback (most recent call last):
File "lottie-exporter.py", line 161, in <module>
new_file_name = parse(FILE_NAME)
File "lottie-exporter.py", line 66, in parse
gen_layers(settings.lottie_format["layers"], root, len(root) - 1)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\layers\driver.py", line 82, in gen_layers
itr)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\layers\group.py", line 85, in gen_layer_group
asset = add_precomp_asset(settings.lottie_format["assets"][-1], canvas[0], len(canvas[0]))
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\sources\precomp.py", line 26, in add_precomp_asset
layers.driver.gen_layers(lottie["layers"], root, layer_itr-1)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\layers\driver.py", line 82, in gen_layers
itr)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\layers\group.py", line 85, in gen_layer_group
asset = add_precomp_asset(settings.lottie_format["assets"][-1], canvas[0], len(canvas[0]))
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\sources\precomp.py", line 26, in add_precomp_asset
layers.driver.gen_layers(lottie["layers"], root, layer_itr-1)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\layers\driver.py", line 82, in gen_layers
itr)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\layers\group.py", line 72, in gen_layer_group
group.update_pos(pos)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\synfig\group.py", line 75, in update_pos
add(waypoint[0], offset)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\synfig\group.py", line 91, in add
vector[0].text = str(float(vector[0].text) + offset[0])
ValueError: could not convert string to float:
Looking into it a little it appears that the script is operating on a scalar when it's expecting a vector and erroring out. Adding
if vector.tag != "vector":
return
before the offending line seems to fix that issue, but a similar error crops up later:
Traceback (most recent call last):
File "lottie-exporter.py", line 161, in <module>
new_file_name = parse(FILE_NAME)
File "lottie-exporter.py", line 66, in parse
gen_layers(settings.lottie_format["layers"], root, len(root) - 1)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\layers\driver.py", line 82, in gen_layers
itr)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\layers\group.py", line 85, in gen_layer_group
asset = add_precomp_asset(settings.lottie_format["assets"][-1], canvas[0], len(canvas[0]))
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\sources\precomp.py", line 26, in add_precomp_asset
layers.driver.gen_layers(lottie["layers"], root, layer_itr-1)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\layers\driver.py", line 82, in gen_layers
itr)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\layers\group.py", line 85, in gen_layer_group
asset = add_precomp_asset(settings.lottie_format["assets"][-1], canvas[0], len(canvas[0]))
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\sources\precomp.py", line 26, in add_precomp_asset
layers.driver.gen_layers(lottie["layers"], root, layer_itr-1)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\layers\driver.py", line 82, in gen_layers
itr)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\layers\group.py", line 76, in gen_layer_group
gen_helpers_transform(lottie["ks"], layer.get_layer(), pos[0], anchor[0], scale[0], angle[0], opacity[0])
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\helpers\transform.py", line 53, in gen_helpers_transform
index.inc())
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\properties\multiDimensionalKeyframed.py", line 32, in gen_properties_multi_dimensional_keyframed
gen_properties_offset_keyframe(lottie["k"], animated, i)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\properties\offsetKeyframe.py", line 353, in gen_properties_offset_keyframe
cur_pos = parse_position(animated, i)
File "G:\Program Files\Synfig\share\synfig\plugins\lottie-exporter\common\misc.py", line 90, in parse_position
pos = [float(animated[i][0][0].text),
ValueError: could not convert string to float:
Yes, this is expected, as the shapes and outlines are exported frame by frame using the most basic layer of Lottie, hence increasing the size of the file. This might also lead to a lag in animation on larger displays/screens.
I have been using firefox and chrome both for testing but did not face this issue yet. Could you raise an issue mentioning the firefox version as well as the .sif file used.
Activity
adampiskorski commentedon Jan 28, 2019
I think this would be a killer feature, as otherwise to have a nice modern pipeline for animations on web + mobile you would need Adobe AE.
Synfig could certainly reduce the barrier to entry and keep the pipeline in the open source world.
ThobyV commentedon Feb 27, 2019
I support this move too. This would be very useful to have in synfig as also the web community Is large and svg-based animation on the web is growing. The thought of Having to use a great tool like synfig to make animations for the web makes me happy.
May I ask, What are the core requirements that could make this happen.
morevnaproject commentedon Feb 28, 2019
We need someone who can code a converter from .sif (Synfig format) to Lottie. This could be done in simple language, like Python.
This task requires knowledge of .sif format (this is just XML and easy to understand) and Lottie format (can be figured out from
https://github.com/airbnb/lottie-web/tree/master/docs/json).
dinolinjob commentedon Mar 2, 2019
I want to implement this feature. Can I work on this one?
ThobyV commentedon Mar 2, 2019
This would mean writing a Python converter that parses XML into structured JSON. Lottie uses JSON and uses a Javascript interface so it's works well for the web.
ThobyV commentedon Mar 2, 2019
Am I right to assume this? Also Would it be some sort of plugin written for Synfig?
AnishGG commentedon Mar 2, 2019
Hi,
I am Anish from IIIT Hyderabad. I would like to contribute to this project in GSOC. I was going through the idea list and this seems interesting. Could anyone help me get started with this?
morevnaproject commentedon Mar 3, 2019
@ThobyV Yes, you right. I think this can be implemented as Python plugin - https://wiki.synfig.org/Doc:Plugins
@dinolinjob @AnishGG welcome to the tread! I suggest to start by implementing a demo plugin that does some very simple conversion. I.e. converts some Synfig file with one simple layer (Rectangle or Circle or Image) to Lottie JSON.
morevnaproject commentedon Mar 3, 2019
@dinolinjob @AnishGG @ThobyV Before starting, please let me know which simple layer you choose to implement - so we make sure each one is taking different task. ^__^
ThobyV commentedon Mar 3, 2019
@morevnaproject I think I'll go with a rectangle svg shape. I will make sure to update us here on my progress. 😄
dinolinjob commentedon Mar 3, 2019
@morevnaproject I will go with a circle.
prasadrathod commentedon Mar 3, 2019
@morevnaproject I am interested either. I'll go with the circle layer Synfig file. I will make sure to update you here. Most of my stuff is on Gitlab with id prasadPVR.
morevnaproject commentedon Mar 4, 2019
Hi @JagsPvr ! The Circle layer task is already allocated to @dinolinjob. Please choose some other layer type. I suggest to take Image Layer or Star Layer (https://wiki.synfig.org/Star_Layer).
morevnaproject commentedon Mar 4, 2019
This might be helpful - https://wiki.synfig.org/Sif_Format
31 remaining items
LaPingvino commentedon Jul 8, 2019
@mbasaglia can you give an example output file so I can test if my Telegram picks it up independently? Also would you be able to create a command line tool just to convert Lottie JSON to tgs? I think that would be really helpful to get other people up to speed.
mbasaglia commentedon Jul 8, 2019
@LaPingvino
Here's a test file (Note: I had to add the gz suffix to upload it to github, for telegram remove ".gz" from the file name, without extracting it)
test.sifz.D35E47A0.tgs.gz
Also keep in mind currently the Lottie exporter is very basic so it can't yet be used to export anything but the most trivial shapes and animations.
I already have utility scripts in the same repo I've linked above. I'm also working on a python library based off the Lottie json schema
mbasaglia commentedon Jul 8, 2019
Quick question: What kind of reference/documentation has been used to describe the lottie format for exporting from synfig? I see some discrepancies between the json schema in the lottie repo and the output from the synfig plugin.
The schema itself seems a bit low quality so I was wondering if there was a better source of info on the format.
AnishGG commentedon Jul 8, 2019
Basically the above mentioned JSoN schema has been used. The keys which are serving no purpose have been removed intentionally. Even the schema has some mistakes in it.
So to be fully sure, you can create the shape/layer in After Effects and use bodymovin plugin to export it to lottie format. This will give you the correct results.
AnishGG commentedon Jul 8, 2019
@mbasaglia
I had a look at the tgs code on gitlab. I noticed that you cloned the lottie-exporter's part which is merged in the master. It does not support splines yet.
But the lattest version #756 supports splines. You might want to clone this instead of the previous version
mbasaglia commentedon Jul 8, 2019
thanks, I've subscribed to that PR, I'll keep my version up to date based on that
mbasaglia commentedon Jul 10, 2019
btw, I did a lot of work on making sense of the lottie format so I developed a python framework that can be used to read and write these files. If there's ever the need to import lottie files into synfig my framework is capable of doing so.
GraithTiger commentedon Jul 20, 2019
I've picked up Synfig and have been trying out the lottie exporter, and I've found that it fails on this file:
noises_graithtiger.zip, giving the error:
Looking into it a little it appears that the script is operating on a scalar when it's expecting a vector and erroring out. Adding
before the offending line seems to fix that issue, but a similar error crops up later:
and it's seeming to fail on this part of the xml:
AnishGG commentedon Jul 20, 2019
Convert methods like
addare not supported yet. These are yet to be implemented.morevnaproject commentedon Feb 7, 2020
The Lottie exporter now shipped in version 1.3.12 - https://www.synfig.org/2020/02/07/synfig-studio-1-3-12-released/
ohlr commentedon Mar 3, 2020
Two things I noticed:
AnishGG commentedon Mar 3, 2020
.siffile used.ohlr commentedon Mar 3, 2020
Thanks for the quick response. I realized point 2 is mainly an issue with large/complex files. I think Firefox is just not as good/fast in rendering.
fire commentedon Feb 14, 2021
https://synfig.readthedocs.io/en/latest/releases/stable/1.4.0.html has lottie export.