Adding Lottie metadata to the TranslationResult in GenericData format.
Some improvements of GenericData as a result of using it more.
Adding code to convert from GenericData to Windows.Data.Json. Not yet used but will be added to LottieVisualSource.
Replacing all of our custom empty arrays with Array.Empty<T>().
* Adding a metadata facility to CompositionObject.
This adds a facility for arbitrary metadata to be added to CompositionObject and uses it for the IDescribable interface.
I also made the IDescribable implementation on CompositionObject explicitly implemented so that it doesn't pollute the API surface of CompositionObject.
And the IDescribable storage is now implemented by the metadata store, which should result in space savings.
* CR feedback.
* Add a cast to eliminate a compiler warning.
std::vector returns a size_t from size(). We assign it to a UINT which results in a warning. Adding a cast to make that warning go away.
* Handle difference in headers used by Windows build system.
* Make parsing resilient to issues seen in our corpus.
Handle unexpected matte types by parsing as "Unknown" and treating them as Add.
Allow parsing errors in layers to result in the layer being ignored rather than giving up. Note that this can result in an issue later on if the layer is searched for but not found.
Handle case of a layer with inPoint == outPoint by ignoring that layer.
Fix comparsion of CubicBezierEasings - equivalent CubicBezierEasings were being reported as being non-equal due to missing == operator overloads.
Handle the case of multiple color gradient stops at the same offset - always use the last one. Designers might do this because in one keyframe the stops are all bunched up against offset 0 or 1, then later they get spread out.
In general, throw exceptions from the parser less often.
Parse and save any extra top-level data in the json file. I plan to expose this in generated code and LottieVisualSource in a later check-in.
Windows.UI.Composition key frames need to have distinct progress values. Sometimes during translation we need to place a key frame as close as possible to a previous key frame. Before this change we did that by adding a small constant however that doesn't always give the smallest possible increment (because the increment depends on the exponent of the float, and because the constant we chose was conservative). With this change we actually calculate the next float value, so it is guaranteed to be as close as possible to the previous key frame.
We were correctly recognizing that we couldn't compose strokes of different kinds, but then we tried to compose them anyway which would result in a failed cast.
* Support gradient opacity stops.
In LottieData we now model opacity and color stops on gradients as a single list of GradientStop which can either be an OpacityGradientStop or a ColorGradientStop.
During translation, we convert that list to a list of ColorGradientStop where the opacity information is carried in the Alpha channel.
During canonicalization, work around an issue with CompositionColorGradientStopCollections which require that a stop object does not appear twice in the same collection.
When translating gradients, use the maximum opacity in cases where we can't support opacity animation. Previously we used the initial opacity, which caused things to disappear if they started out with 0 opacity. Maximum opacity will allow the items to show up, which makes it easier to debug.
Updated the temporary cert used when building LottieViewer - the old one had expired.
* Update the samples cert - it had expired.
* Add support for gradient strokes.
* Make IRadialGradient compatible with pre-8.0 C# compiler.
WinRT can't use C# 8.0 yet, and the "public" on interface members is a C# 8.0 feature. It was a mistake to have "public" on there anyway.
* CR feedback.
C++ gets confused if you try to "new" a type with the same name as something else in scope. This was causing compilation failures on generated code when we tried to new a CompositionPath and there was a method called CompositionPath().
This only affected C++ because C# is smarter and doesn't expect a "new" of anything but a type.
The workaround is to always use counter-suffixed names for node names (and therefore for method names).
Previously we special-cased nodes for which there was only one with a particular type. This change removes that special-casing.
* Anti-alias the edges of masks and mattes for a smoother result.
The default BorderMode for Visuals is Inherit, and if not specified the value Hard (i.e. not anti-aliased) is passed into the root.
The default worked for us previously because the desktop tree sets the BorderMode to Soft and we inherit it so we got Soft behavior everywhere.
However the trees created for masks and mattes are not rooted in the desktop, so they were getting set to Hard and some edges looked aliased.
This change adds the ability to set the BorderMode and sets it to Soft for the trees created for masks and mattes.
* Improve comments.
* Define a sorting order for elements in codegen that aligns better with human expectations.
This deals better than the old ordering with names that have numbers embedded in them,
for example img_001, img_11.
The old ordering was particular bad for images provided by designers, resulting in code that looked like it had things in the wrong order.
* Update nuget dependencies to latest non-prerelease versions.
* Updating the version of .NET Core UWP support.
I had previously updated the Nugets for the solution, but apparently that's not sufficent.
This issue was producing uncompilable code on some very simpler Lottie files that didn't need references to the root node except through the IAnimatedVisual interface.
* Refactor codegen to output multiple versions.
This does not output multiple versions - that is coming in
a subsequent change.
* Handle the LoadedImageSurface objects in a way that will allow them to be shared between different versions.
* Fix licensing headers on a couple of source files.
* Stop using C# 8 switch statements.
They're not usable from LottieViewer because UWP doesn't allow C# 8 yet.
* Build break
I missed converting one of the switch expressions.
* CR feedback - comment tweaks.
* Versioning stage 2. Translate multiple times to support multiple UAP versions.
This translates but does not yet codegen the multiple versions.
* A few small things I noticed in CR.
* CR feedback.
* Fix build break.
* Work in progress towards versioning.
This adds a number of pieces required to generate version-adaptive code, but doesn't
yet hook those pieces up. This allows testing against a corpus to ensure nothing is
broken. A future commit will add version-adaptivity.
* Fix build break.
* CR style feedback.
I meant to fix this but must have forgotten. It was a byproduct of some experimentation.
* CR feedback.
* CR feedback.
* CR feedback.
* Remove the -ClassName command line option from LottieGen.
The -ClassName option allowed you to override the name generated for a class for a Lottie. However it was
rarely used, and it makes no sense when using globs to specify more than one Lottie file. The functionality
to control your class name is still available via a workaround: rename your .json file.
* Cosing style fixes.
Deal with colors that have objects in the alpha channel.
Deal with key frame that are redundant (they have a following keyframe at the same frame offset).
Deal with assets that have non-unique IDs.
Report unexpected exceptions in LottieGen.
* Enable more linear gradient fill cases, including animated linear gradients.
* Addressing CR feedback.
* Better stats for LottieGen (#148)
* LottieGen reports stats to a TSV file instead of CSV.
Added a more general stats reporting mechanism.
* LottieGen: eliminate Verbose option and replace with much better stats file outputs.
* CR feedback.
* Enable more linear gradient fill cases, including animated linear gradients.
* Addressing CR feedback.
* Refactor parsing of gradient stops to separate the color and opacity stops.
Ignore opacity if it is specified for a gradient, rather than rendering nothing.
* Atomize empty arrays. Renaming of the contents of ShapeGroup to be consistent with ShapeLayer.
* LottieGen reports stats to a TSV file instead of CSV.
Added a more general stats reporting mechanism.
* LottieGen: eliminate Verbose option and replace with much better stats file outputs.
* CR feedback.
* Preparing for implementation of gradients.
* Make LottieGenCorpus more deterministic.
Previously the output depended on the width of the console, and sorting ignored case.
* Upgrading to SDK 18362 (May 2019) so that we can use RadialGradientBrush.
After Effects (and the web) use RGB interpolation for color animations. Composition support HSL and RGB, but defaults to HSL. HSL is rarely useful if the animation goes through white or black because there are multiple representations of white and black so the interpolation is poorly specified.
With this change, Lottie-Windows always uses RGB interpolation.
* Initial changes for multi shape mask and matte translation support
* Add new tranlation issues and fix some issues after merge
* Editing TranslateAndApplyMasks return value when VisualSurface is not supported
* Initial changes for getting composite effect to work without win2d
* Minor change and a fix before PR
* Addressing previous iteration comments
* Addressing previous iteration comments
* Addressing current iteration comments
* Fix minor missed issue from previous iteration
* Addressing previous iteration comments