lottie: gradient slot issue
The provided Lottie file contains the following slots:
"slots": {
"gradient_fill": {
"p": {
"a": 0,
"k": [0, 0.1, 0.1, 0.2, 1, 1, 0.1, 0.2, 0.1, 1]
}
}
}
I expected the gradient to render as shown in this image:
but, for some reason, it’s not being rendered correctly, as shown here:
By replacing original gradient array, it renders what we expect. Something happens in overriding makes colorStops different.
I'll look into this. Thanks for reporting.
@theashraf I have a question regarding to overriden colorStop value.
Let's say original gradient has 2 colorStops in one sid before overriding. Is new colorStop from slot same length as well?
Or any possible situation that different length of gradient will come and be overriden?
https://github.com/lottie/lottie-spec/issues/105
@tinyjin @mgrudzinska Even our sample don't have value count, shouldn't our Lottie Extension sample suggest like this?
yes, slotsample.json and test case lottie slot should be updated
agree, the "p" value would suggest how many colors stops will be changed
@theashraf Please review the form change carefully, leave any feedback. This may break dotlottie player compatibility. Otherwise, the fix will be in the next release (v0.15.4).
slot data to override:
{
"gradient_fill": {
"p": {
"p": 2, // 2 color stop count
"k": {
"k": [
0,
0.1,
0.1,
0.2,
1,
1,
0.1,
0.2,
0,
0,
1,
1
]
}
}
}
}
slot data target:
"g": {
"p": 9, //9 color stop count
"k": {
"a": 0,
"k": [
0,
0.514,
0.373,
0.984,
0.141,
0.478,
0.412,
0.984,
0.283,
0.443,
0.451,
0.984,
0.379,
0.408,
0.49,
0.984,
0.475,
0.373,
0.529,
0.984,
0.606,
0.278,
0.647,
0.925,
0.737,
0.184,
0.765,
0.867,
0.868,
0.092,
0.882,
0.808,
1,
0,
1,
0.749
]
},
"sid": "gradient_fill"
}
@hermet I need to review this with lottie-web, let me come back to you soon. I wonder if animated gradient slots is also supported ?
@theashraf yes, it should.