GSOC-2019::Export Animation for Web



@KonstantinDmitriev, I have created a PR for documentation. Please have a look at it. :slight_smile:


Am I right to assume that only hold interpolations are present for the points parameter in star layer?
I tried experimenting with it, the only behaviour I could reproduce was hold/constant.
@BobSynfig any inputs would be appreciated :smile:


Lottie does not support animation for change between polygon/star parameter for the star layer. To support it, my suggestion:
whenever the polygon parameter is true, I will change the inner radius of the star such that the star looks like a regular polygon. (Mathematically: inner radius = outer radius * Cos(theta/2); theta = 360/Number of points)
Please give your input on this. If ok, I will start working on it.


Yes, this is good solution! :slight_smile:


This is not really a hold interpolation. The points parameter has integer type, so it will change non-smoothly.


…Here is an example:


(blue star uses Linear interpolation, red star uses Constant interpolation).

Source file - star-ponts.sifz (1017 Bytes)


BTW, after looking at Graphs panel, I have found that change of Points parameter is not really linear -

This looks like bug, I have filled an issue for that -


Yes, This seems to be a bug. For now, I will leave this points interpolation and work on animation of polygon/star parameter.
Thank you! :smiley:


This task seems to be much difficult than what I thought of. I need insert and remove waypoints from the animation to achieve this. So I am devising an algorithm to take care of all the corner cases.
In the mean time, I will also start working on other layers for a good progress.
So this marks the finish of star layer. I have tested it from my side and everything seems ok till now.
@KonstantinDmitriev could you test this layer? Please inform if anything seems off.


You right, if inner radius is animated, then your code should take this into account and modify/replace waypoints in time segments where polygon parameter changes.

I will test the exporter for Star Layer and get back with my feedback. :slight_smile:

What layer type you would like to implement next?


I will get started with circle layer?
Also should push this new layer’s work on the same PR? Or a new pull request?


Circle layer - good. :slight_smile:

Let’s use the same PR. Just rename it accordingly. :slight_smile:


Weekly Update(19-26 May):

  • Implemented the export of circle layer. (link)
  • Implemented the export of rectangle layer without animations. Lottie format uses origin and length of the 2 sides of rectangle to define the rectangle layer whereas Synfig uses two extreme points of the rectangle to define the layer. Hence I need to devise an algorithm to take care for the export of all the corner cases. But I am facing this issue while doing it. Any suggestions or help on this issue will be much appreciated.
  • Added documentation for the circle layer and the supported features of the layers. (link)
  • An HTML file along with the raw json data is now generated by the plugin as per the feature request by @KonstantinDmitriev. (link)
    In the next week, I will be focusing on solving the issue given in second point and completing the rectangle layer. Also, will start working on the next layer. (That might be simple circle layer)
    Any suggestions or improvements are most welcome! :smile:
    That is it for this week.


Weekly Update(27 May - 1 June):

  • Implemented the export of simple circle layer. (link)
  • Implemented the export of solid color layer. (link)
  • Rectangle layer point1 and point2 animations now working properly. This task required major implementation and thinking!
  • Started working on import image layer.
    In the next week, I will be working on expand parameter of rectangle layer, will be finishing import image layer. Moreover, I will remove code smells introduced till now and write developer documentations for the above implemented layer.
    Any feedbacks or suggestions will be much appreciated!
    That is it for this week.


So I started with the region layer. The export is working perfectly when no animations are introduced in region layer. The problem I am facing is: In Synfig, a bline point's parameters can be animated independent of each other. For example: t1 and t2 are animated independent of each other.
But in Lottie, the 3 parameters: t1, t2 and point have common animation properties(in tangent and out tangent of bezier curves).
The best way to address this problem, according to me, is to generate the data for each frame and save it in Lottie Json format. But this will have an effect on file size generated.
Can anyone suggest a better way besides this? Or should I continue with this only?


Yes, that’s a problem.

Probably, it is possible to generate data for each waypoint. I.e. if one parameter has waypoint at some moment of time, then it is needed to generate waypoints for other parameters. That will require additional calculations to preserve shape of animation curve. But that’s should be possible, as this algorithm already implemented for BLines -


I understand that waypoints can be generated while preserving the shape of animation curve.
But the problem is consider a time t, at this time, consider a situation when t1 has clamped interpolation, t2 has hold interpolation and point has linear interpolation. This can not be handled by Lottie because, at a time t, all these 3 parameters should have same interpolation according to Lottie.
That is why I was suggesting data generation for each frame.
@KonstantinDmitriev, should I then continue with data generation for each frame?
Please correct me if I am wrong here.


You right. :slight_smile:

On the other hand, from my experience it is not very common case when user sets interpolation independently for tangents and point. This case can take place when figure (Region) has not many points. When figure has many points, then it is very likely that t1, t2 and point has same waypoint interpolation.

I suggest to make a combined solution:
Say, we have a segment from one waypoint to another. Then we analyze if t1, t2 and point can have same interpolation (including “calculated” waypoints). If “yes”, then add “calculated” waypoints (keping the shape of animation curve). In “no” - then generate data for each frame on that segment.


The combined solution looks good to me.

One more problem arose while exploring the region layer: At a time t, In lottie format, all the spline points(means all spline points and all it’s parameters) should have same interpolation. This makes it extremely unlikely that all the spline points and it’s parameters will have same kind of interpolation in Synfig animation. Hence, I will first work on generating data for each frame. And then do the analytical part, and if interpolation type is same for each waypoint and spline point, then do as you suggested above.
Is this okay?


Weekly Update(2 June - 8 June):

In the next week, I will be working on animation of region layer according to the discussion with @KonstantinDmitriev above and write developer documentations for the layers implemented till now. Will also try to update the documentation for supported layers.
Any feedbacks or suggestions will be much appreciated!
That is it for this week.