GSOC-2019::Export Animation for Web

Can a gradient layer have any number of colors? - This was asked by @saurabh22 to me some time ago.
By default there are 2 colors, but when the gradient is animated over time, the interpolated frames show upto 4 colors.
I was not able to manually add more colors to a gradient. Can someone clarify how to add more colors to a gradient.
@ice0 @KonstantinDmitriev

2 Likes

Hi! It is possible to add any number of colors to gradient. Here is a video showing how:

3 Likes

Thanks for the video!
Even I tried right click on this area, but it is not working for me. (Ubuntu 18.04 LTS)
But on windows 10 it worked.
May be I am using an old build in Ubuntu and that is why it is not working there. Will create a new build and report soon!

2 Likes

I have raised an issue regarding the same:

2 Likes

I am currently working on exporting gradient layer (https://github.com/synfig/synfig/issues/934)
I understood how to calculate the interpolated data between two waypoints for any two parameters. But I am not able to find where all this resides in the Synfig code. I need it for the implementation of gradient layer.
It would be very helpful if you could help me on this @AnishG. :smile:
TIA

1 Like

You will find it in this file: synfig/synfig-core/src/synfig/valuenodes/valuenode_animatedinterface.cpp at 2503cc440f8377a29beaa80f11e9338a5d7f15cd · synfig/synfig · GitHub
The corresponding code in the lottie exporter resides here(you will have to make changes here): synfig/synfig-studio/plugins/lottie-exporter/properties/offsetKeyframe.py at master · synfig/synfig · GitHub

Currently, Lottie uses same in and out tangents for the calculation of all four properties of color(RGBA), and hence I used an approximate interpolation for colors. You can do the same for the gradients initially, but at a later stage, we can generate gradient data for each frame(as we are currently doing for outline layer).
Also the synfig format in and out tangents can be accessed using the synfig_i/synfig_o keys.
Ping me if you have any other queries. :slight_smile:

3 Likes

@AnishG thank you for the help :smile:

1 Like