Skip to content

Releases: CommunityToolkit/Lottie-Windows

v6.1.0

15 Jun 16:46
69c23b7
Compare
Choose a tag to compare

This release brings a new theme property binding feature, better Lottie feature support, performance improvements and bug fixes.

Theme property binding

This feature enables properties in Lottie files to be bound to values at runtime. This enables scenarios such as synchronizing colors in your Lottie file to the Windows theme colors.

Theme property binding was developed to support fill color binding, however it also supports StrokeWidth and opens the door to enabling other property bindings.

To make an After Effects color fill bound to a property at runtime, the name of the fill needs to include (CSS-like) syntax such as the following: "{color:var(Foreground)}". This will create a property in the generated code called "Foreground".

Property binding default values are exposed as constants. This allows these default values to be used in supporting code without having to instantiate the IAnimatedVisualSource object.

The ColorAsVector4(…) method in generated code is to help developers set color properties. Due to a limitation of the Windows.UI.Composition APIs, we can't use the Windows.UI.Xaml.Color type for doing property binding. We use Vector4 instead and this method ensures the conversion from color to Vector4 is done the same way by developers as is expected by generated code.

Lottie feature support

  • Handle opacity and color animated on the same element.

Code generation

  • Rich generated comments about the Lottie contents, and the code generation.

    • We now generate comments that identify the version of the tool, when it was run, the input file, the command line arguments, etc., etc., so that it's easier to keep track of how the file was generated, and to regenerate with identical options when the Lottie file changes.
    • We generate various tables in the comments to help developers understand the contents of the generated file. These include information about markers, and counts of some important objects. Object counts are useful for determining whether a change to a Lottie file may have regressed performance.
  • New code generation options.

    • Added "-Namespace" option to put the generated code into a user's namespace.
    • Added "-Public" switch to generate public classes. Generated code defaults to internal, but can be overridden with this switch.
    • Added "-TestMode" switch to generate code that doesn't change given the same inputs (e.g. no timestamps are included in the output). Used for regression testing.
  • Code quality improvements.

    • Abstracted common patterns (e.g. creating a shape and setting its fill) into methods. This results in smaller code that is easier to read.
    • Canonicalize progress remapping variables. These are the "t1", "t2", etc. variables that are used to support spatial Beziers. Canonicalizing can reduce the number of variables (and their associated costs).
    • Use "Visual.IsVisible" property for visibility control. This was previously not possible due to requirements to run downlevel (where this property was not available).
    • Use "CompositionShape.Scale" for visibility on shapes instead of TransformMatrix. This generates more efficient code and enables more optimizations.
    • Gradient stop optimization. After Effects does not remove redundant gradient stops, and simple gradients often have a redundant "middle" gradient stop. We can now detect and remove redundant gradient stops.
    • Eliminate redundant "Position" animations.
    • Compact expression strings to save some bytes.
    • Readability improvements for generated code.
    • Method naming improvements.
    • Matrices now have comments explaining what they do.
  • C++/WinRT

    • Limited support for C++/WinRT. This is enough support to satisfy the needs of some Microsoft teams, but should not be considered general support yet. Bug reports are welcome though and we will work towards full support.

Metadata handling

  • Added a general metadata facility for all CompositionObjects. This allows arbitrary data to be passed through the translator. It is used for Lottie metadata (e.g. markers), property binding, object names, and object descriptions.

Parser performance

  • Removed dependency on the Newtonsoft JSON parser. We now use the System.Text.Json parser. Parsing performance improved ~50%.
  • Parsing is more resilient to malformed and invalid Lottie files.

Lottie Viewer

  • Remove support for code generation from the Lottie Viewer tool. Code generation can now only be done by the LottieGen.exe tool. This is so we can add lots of options to the code generator without complicating the Lottie Viewer UI. It also means there is only one way to generate code, which allows for more repeatable code generation in production environments.

Bug fixes

  • Prevent use of PathKeyFrameAnimations before UAP v11. PathKeyFrameAnimations are unreliable on earlier versions and may result in a crash.
  • Miter limit on strokes was being calculated incorrectly.
  • Rounded rectangle roundness was being calculated incorrectly.

v6.0.0

13 Nov 19:08
Compare
Choose a tag to compare
  • platforms & tooling 🚀

  • improvements

    • Support for common radial gradient fills. - Simeon (PR)
    • Enable more linear gradient fill cases, including animated linear gradients. - Simeon (PR)
    • Enable image layer with external and embedded image assets. - plaiMS (PR)
    • Handling Opacity on Layers. - Simeon (PR)
    • Multi-shape mask and matte translation - eliezerpMS (PR)
  • other fixes

    • Adding some of the pieces needed for supporting image assets - Simeon (PR)
    • Fixes a bug with the generated CX code when it uses geometry groups. … - Simeon (PR)
    • Adding a new project UIData to reference WinUIXamlMediaData. - plaiMS (PR)
    • Enable VisualSurface now that we are using the 1903 SDK. - Simeon (PR)
    • Override the default interpolation color space of ColorKeyFrameAnimation to align with After Effects - Simeon (PR)
    • Prepare for gradients - Simeon (PR)
    • Enabling simple LinearGradientFill cases. - Simeon (PR)
    • Updated comment on CompositeVisuals - eliezerpMS (PR)
    • Add support for Effects without Win2d for Cpp/Cx - eliezerpMS (PR)
    • CodeGen IDynamicAnimatedVisualSource for composition with LoadedImageSurface. - plaiMS (PR)
    • Make the generated CX classes public. This allows them to be used in XAML - Simeon (PR)
    • Fixing incorrect (didn't compile) CX codegen for geometry groups. - Simeon (PR)
    • Clip precomps with the correct size. - Simeon (PR)
    • Fix for issue 117. During translation, don't pass the layer around wh… - Simeon (PR)
    • Small refactoring to simplify and share code for creating shape visual - Simeon (PR)
    • Setting Opacity transforms on layer. - plaiMS (PR)
    • Fix issue 117 -- Create new context for the layer being processed. - plaiMS (PR)
    • Add parsing for blend mode (bm) on ShapeLayerContent. - Simeon (PR)
    • Add data representation of IRandomAccessStream for use by LoadedImage… - Simeon (PR)
    • Adding pieces in Translator, ObjectGraph, Optimizer, Instantiator to support embedded images in LottieVisualSource. - plaiMS (PR)
    • Move the YAML object model so UIData can use it. - Simeon (PR)
    • Fix a comment typo. - Simeon (PR)
    • Adding first pieces needed in LottieToWinCompTranslator to enable image layer. - plaiMS (PR)
    • Refactoring code that references WinUIXamlMediaData and WinCompData to UIData. - plaiMS (PR)
    • Include LottieYaml outputs in the tests. - Simeon (PR)
    • Ensure node names don't conflict with type names for C++. - Simeon (PR)
    • CX codegen fixes - Simeon (PR)
    • Handle AnimatedVisuals where different versions need different parameters. - Simeon (PR)
    • Optimize calls to CompositionVisualSurface.SourceOffset and .SourceSize. - Simeon (PR)
    • Anti-alias the edges of masks and mattes for a smoother result. - Simeon (PR)
    • Add Scott as a code owner so he gets on the CR list for each PR. - Simeon (PR)
    • The (perhaps) final part of version-dependent code generation. - Simeon (PR)
    • Update nuget dependencies to latest non-prerelease versions. - Simeon (PR)
    • Fix for #161: Ensure storage is allocated for the root node in codegen. - Simeon (PR)
    • Define a more sensible sorting order for elements in codegen - Simeon (PR)
    • Prerequisites for versioning. - Simeon (PR)
    • Versioning stage 2. Translate multiple times to support multiple UAP versions. - Simeon (PR)
    • Refactor codegen to output multiple versions. - Simeon (PR)
    • Add metadata to the WinCompData types to indicate at which UAP versio… - Simeon (PR)
    • We were turning off opacity incorrectly in the case of masks on ShapeLayer. - Simeon (PR)
    • Remove class name option - Simeon (PR)
    • Give more info in the gradient fill issue messages. - Simeon (PR)
    • Improve many masks cases, especially combinations of Add and Subtract… - Simeon (PR)
    • Better stats for LottieGen - Simeon (PR)
    • Harden against some unexpected cases in Lottie json files. - Simeon (PR)
    • More updates to LT pages - sohchatt (PR)

5.1.0

13 Nov 16:18
815127a
Compare
Choose a tag to compare

Initial Package Release