GSOC-2019::Export Animation for Web

lottie
export

#62

SOT isstnds for “Start of time” - https://github.com/synfig/synfig/blob/master/synfig-core/src/synfig/time.cpp#L68-L85
This is a reference to first frame on the timeline.

There is also EOT - “End of time” (last frame of timeline).

As I can see, for some technical reasons, if some vertex has animated on/off states, then Synfig forces to auto-insert a “virtual” waypoint at SOT.

In our case the 0f waypoint duplicates SOT waypoint. I guess this is a technical issue.


#63

Well this gave me lots of clarification :slightly_smiling_face:. The link provides more information about how time is stored(I have not provided support for when time is given in hours or minutes), hence now I can provide support for it.
Also, I am attaching a modified version of the region layer file attached in above posts. Vertex 2 is on at 0f and off at 1s.
Consider I want to calculate the shape of layer at 12f. How do I calculate the position and tangents of Vertex 2 at this point?
My guess: Make Vertex 2 animated such that it’s final value(on 1s) lies somewhere on the spline connecting Vertex 1 and Vertex 3.
Can you verify if I am on the right path here @KonstantinDmitriev? Or I it would be of so much help if you could provide me some source code where all this calculation is done.
Thank you!
insert_item_region.sifz (1.0 KB)


#64

Exactly! :slight_smile:

I do not remember where exactly this code located. Need some time to find out…


#65

Found! It is calculated in this function - https://github.com/synfig/synfig/blob/dbcff0d792e6ff53fe4daaf8aed5a3ba216669d2/synfig-core/src/synfig/valuenodes/valuenode_bline.cpp#L634


#66

Getting back to our earlier discussion:

I can see that the feature of enabled/disabled vertices adds one more level of complexity for analytical part. ^__^"


#67

Yes, this seems to be the case unfortunately. I am wondering if the analytical part will yield any practical advantage in space reduction v/s time increase. As it will very unlikely that all the spline points and it’s parameters will all be animated for any 2 waypoints + also have same interpolation kind. Hence this might not be a space reduction, but only contribute to increase in time taken by the plugin to export.


#68

Yes, this is also what I am thinking about.

The output file size and export time do not really bother me. What I am concerned about is performance of Lottie player: I am afraid that it is going to be slower (more resource-demanding?) when lottie file has spline data generated for each frame. But maybe that’s not the case - this can be verified by doing some tests.


#69

I will try to get some more insight from lottie developers on this part.


#70

Weekly Update(16 June - 22 June):

  • Exporting now supports time in hours and minutes.
  • Started working on outline layer.
  • Updated developer documentation (link)

Overall, my pace was slower than previous weeks due to some college related work, but I will catch up on it this week.
In the next week, I will try to complete the outline layer as well as get familiar with the code for animation of addition/removal of vertices from spline.
Any feedbacks or suggestions will be much appreciated!
That is it for this week. Stay tuned for the next update. :smiley:
-Anish


#71

So while dealing with outline layer, I got some problems:

  • Consider Vertex 1(V1), how are P1 and P2 calculated from vertex 1? What I was trying to do is: calculate the angle(A) of the spline point on this vertex, then to calculate P1:
    P1 = V1 + width*direction
    P2 = V1 + width*direction
    where direction if calculated using angle = (A + 90), and angle = (A - 90) depending on P1 and P2.
    So in this case, my tangents angle is -90 degrees. Hence the line joining P1 and P2 should be horizontal.
    But this is not happening in the rendering as seen in the screenshot.
    @KonstantinDmitriev please have a look at this.
    File: out.sifz (1.0 KB)

#72

@AnishG Please consider, that internally Synfig also drawing outline as generic Shape and the code is located here - https://github.com/synfig/synfig/blob/master/synfig-core/src/modules/mod_geometry/outline.cpp#L176-L181


#73

Thank you for informing! I will refer this while exporting.


#74

Just to be clear, do you mean Synfig uses a region layer(by manipulating the vertices) to form an outline layer?
@KonstantinDmitriev


#75

Strictly speaking it isn’t. Outline Layer and Region Layer are both inherited from Layer Shape:


Layer Shape is a pseudo-layer, that used as a base for visualization geometric data:


#76

But you got right the general idea - Synfig uses a Shape layer (by manipulating the vertices) to form an outline layer. :slight_smile:


#77

Weekly Update(23 June - 29 June):

  • Add support for outline layer. Round tips are not supported yet.
  • Add support for invert parameter for polygon, region and outline layer. (link)

In the next week, I will be adding support for round tips in outline layer and updating all the developer documentation for the layers exported till now. I will also try to get started with the rotate layer.
Any feedbacks or suggestions will be much appreciated!
That is it for this week. Stay tuned for the next update. :smiley:
-Anish


#78

Weekly Update(30 June - 6 July):

  • Add support for round tips in Outline layer.
  • Updated developer documentation (link)
  • Add Rotate layer export.
  • Add Scale layer export.
  • Add Translate layer export.
  • Removed bug which did not allow export of files with only 1 frame. (link)

In the next week, I will be adding support for group layer. Will also try add support for invert parameter of remaining layers in this issue.
Any feedbacks or suggestions will be much appreciated!
That is it for this week. Stay tuned for the next update. :smiley:
-Anish


#79

Weekly Update(7 July - 13 July):

  • Add export of group layer. z-depth parameters are yet to be supported.
  • Add support for invert parameter in circle, rectangle and star layer. (link)
  • Add export of switch group layer.

In the next week, I will be adding support for z-depth parameters in the group layer. Will also try to update the documentation for the newly supported layers. I also encountered a problem with the import image layer(it’s opacity is not exported properly), hence I will be correcting this accordingly.
If done with all this, then I will be starting with duplicate layer.

Any feedbacks or suggestions will be much appreciated!
Stay tuned for the next update. :smiley:
-Anish


#80

Hi! I would like to suggest to give a priority to Skeleton Layer instead of Duplicate Layer. This is a very commonly-used layer for animation and closely related with Group Layer. :slight_smile:


#81

Sure! I will look into it first then!