Граф коммитов

34 Коммитов

Автор SHA1 Сообщение Дата
Alexandre Zollinger Chohfi 9c5168a739
Updated Cake build system to newer version, and updated source to net7.0. (#530)
* Updated Cake build system to newer version, and updated source to net7.0.

* Small fix on version number.
2023-04-18 22:59:16 -07:00
Simeon 076223b8be
Fix for security issue in System.Text.Encodings.Web v4.7.1. (#434)
Error reported:
Microsoft.Toolkit.Uwp.UI.Lottie v7 uses System.Text.Encodings.Web v4.7.1 which has a high severity security vulnerability and as such doesn't pass component governance

This upgrades all of the runtime NuGet packages to the latest version.
2021-04-01 11:40:00 -07:00
Simeon 4e15df53a4
Create a project just for the animatables. (#413)
* Create a project just for the animatables.

The animatables are types that are used by both LottieData and the upcoming
intermediate representation, so we need them to be in a separate project so
the code can be shared.

This also adds some small features to some animatables for use by IR, and
changes some IAnimatableVector3 types to IAnimatableVector2 (e.g. gradient
stops should never by vector3.

I've also removed the "property index" from animatables. That is a Lottie concept
that is only needed if you are supporting javascript expressions. We will never
support javascript expressions, so they're not needed. Removing them makes the
code a bit cleaner.
2021-01-27 13:10:48 -08:00
Simeon 5bb8140bab
Add support for LayerVisual and DropShadow Composition types. Cleanup. (#390)
* Add support for LayerVisual and DropShadow Composition types. Much cleanup.

Getting ready to actually support DropShadow - we need some Composition types added.
As a result of adding the Composition types, I noticed many small cleanup tasks and included them.

Fix issues caused by update to VS 16.8 release.
Remove NullablesAttributes workaround for .NET Core 3.1 projects.
Now that we are building the .dll projects with .NET Core 3.1, the NullablesAttributes project is redundant and conflicts with the built-in nullables support in .NET Core.
2020-11-20 14:37:40 -08:00
Simeon 300df24bbe
Allow external images to be loaded, and add .lottie file support (#374)
* Allow external images to be loaded by LottieVisualSource, and add .lottie file support.

External images (i.e. images that are not embedded in the .JSON file) are a problem for LottieVisualSource because it doesn't know how to get them. For securit reasons, we don't want LottieVisualSource to have the ability to read files that are referenced from a Lottie .json file, and in many cases LottieVisualSource wouldn't be able to resolve the file because it doesn't have permissions.

This change adds an ImageAssetDelegate that the user can set on the AnimatedVisualSource in order to handle reading of external images.

This change also adds support for the .lottie format (see https://dotlottie.io). There is a parser for .lottie files, and support in LottieViewer for displaying Lotties from a .lottie file. Because .lottie files package images together with the .json Lottie file, it enables LottieViewer to display Lotties that have external images.

* Fix some bugs that were obvious when I started to CR.

* CR feedback.

* CR feedback.

* CR feedback.

* Fix typo in header.
2020-10-23 15:28:58 -07:00
Simeon b04e5a0a05
Fully enable nullables. (#363)
* Fully enable nullables.
2020-10-13 10:21:17 -07:00
Simeon 6cd496c890
LottieViewer: UI for color palette editing, and show marker values in info panel. (#332)
* LottieViewer: allow palette colors to be changed, and markers in the info panel.

This change required more space for the color picker, and that it didn't cover up the playing Lottie, so the info and play speed and color picker are all now implemented as panels that slide out from the right.
2020-08-31 17:20:26 -07:00
Simeon 69c23b7c13
Update nuget packages to the latest versions. (#290) 2020-06-12 13:08:13 -07:00
Simeon 76565f1182
Replacing Newtonsoft with System.Text.Json. (#247)
This removes our dependency on Newtonsoft for JSON parsing. We'll now use the newer System.Text.Json reader.
2020-02-21 18:12:21 -08:00
Simeon 061ab6a318
More json refactoring towards System.Text.Json (#244) 2020-02-19 13:51:08 -08:00
Simeon ce1e7f194c
Refactoring and clean up that does not change the output. (#209)
Refactoring and clean up that does not change the output.
Getting ready for new features.
Switch UIDataCodeGen.dll to .NET Core 3.0 because it now uses C# 8. Enable .NET Core 3.x on build machines.
Add comments to the ADO yaml file so it's easier to figure out next time.
Update to the latest build.ps1 file from Cake.
Address warnings from build.cake about the addins not being pinned to a particular version.
2020-01-09 10:02:53 -08:00
Simeon a02bb53828
Add metadata comments to generated code: markers, bound properties, et al (#206)
* Add comments to generated code for markers, bound properties, and other metadata.

This adds comments such as:
    // Name:        QA_Wifi_Tagged
    // Frame rate:  60 fps
    // Frame count: 60
    // ===========
    // Segments (aka markers):
    // "1"             0mS  player.SetProgress(0)
    // "2"             0mS  player.SetProgress(0.5)
    // "Tap_On"      450mS  player->PlayAsync(0.55, 0.775, _)
    // "Tap_Off"     400mS  player->PlayAsync(0.775, 0.975, _)
    // "DeadFrames"   33mS  player->PlayAsync(0.975, 0.9915, _)
    // "Opaque"        0mS  player->SetProgress(0.991666666666667)
    // ===========
    // Property bindings:
    // "Foreground"
2019-12-23 18:18:19 -08:00
Simeon 7dc82de085
Move code generator code into its own module (#199)
* Move codegen code into its own module so that projects that don't use codegen don't include it, and so we can start using C# 8.0 in the codegen code.
2019-12-06 12:35:06 -08:00
Simeon cd4aa2ffe2
Pass Lottie metadata (frame rate, etc) through translator to the code generators. (#197)
* Pass Lottie metadata (frame rate, etc) through translator to the code generators.
Add ability to convert GenericData object to code-genned Windows.Data.Json objects.

This change passes the data through but doesn't yet change the output of the code generators. That will come soon when we figure out what clients would like to have.

* Remove some dead code.

* Removing C#-8.0-ism from code used by UWP.

Switch expressions are new in C# 8.0. UWP requires C# 7.0 so the LottieVisualSource won't build with them.
Now that LottieVisualSource doesn't support codegen, we should refactor this so that codegen can use C# 8.0 (which is ok for LottieGen because it's .NET Core so can use C# 8.0).

* Remove another piece of C# 8.0 that snuck in. It breaks LottieVisualSource builds.
2019-12-05 13:07:37 -08:00
Simeon d10a0fbb9e
Make parsing resilient to issues seen in our corpus. (#190)
* 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.
2019-11-20 16:46:09 -08:00
Simeon 5e2bc5c879
Update nuget dependencies to latest non-prerelease versions. (#164)
* 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.
2019-10-24 10:49:02 -07:00
Phyllis Lai aeae000226 Set Opacity transform on layer. 2019-05-20 16:10:42 -07:00
Simeon f2542f8349
Add data representation of IRandomAccessStream for use by LoadedImage… (#112)
* Add data representation of IRandomAccessStream for use by LoadedImageSurface.

LoadedImageSurface doesn't actually do anything with IRandomAccessStream yet.
Also tweaked the samples csproj to get rid of a warning.

* CR feedback, and fixing race in the build.

* Fix cake file.

* Work around race condition in the build.

* Fix typo on commen
2019-05-17 16:10:19 -07:00
Simeon 78d854dbb4
Move the YAML object model so UIData can use it. (#108)
* Move the YAML object model and writer into its own project so it can be shared by UIData.

The YAML stuff was exclusive to LottieData before. But now I want to use Yaml for dumping WinCompData trees, thus this refactoring.

* Fix the licensing header.
2019-05-06 11:30:22 -07:00
Phyllis Lai 45ad0998f4 Adding major pieces in Translator, ObjectGraph, and Instantiator to support embedded images. 2019-04-30 17:00:36 -07:00
plaiMS c26a0390d4 Adding a new project UIData to reference WinUIXamlMediaData. (#102)
* Added new project to reference WinUIXamlMediaData

* Reorder imports in alphabetical order.
2019-04-24 09:53:20 -07:00
Simeon 2fceb1c692
Adding some of the pieces needed for supporting image assets (#101)
* Adding some of the pieces needed for supporting image assets

Support for embedded images in Lottie files.
Introducing the WinUIXamlMediaData project so we can bring in LoadedImageSource for loading images.

* Small refactor for readability.

* Replace the CompositionSurfaceBase with ICompositionSurface.

The CompositionSurfaceBase made sense when the only implementations of ICompositionSurface
were also CompositionObjects. But with support for LoadedImageSurface that all changes.
This change is only part of the solution - in order to support LoadedImageSurface without
introducing a circular dependency between WinCompData and WinUIXamlData we will need to
add a new project for anything that needs to refer to both of them, i.e. the ObjectGraph,
Instantiator, Optimizer, codegen, and the dumpers.

* Fixing build break.
Adding CleanObjs.cmd script to easily delete all obj directories. This can be useful when diagnosing build issues because the regular clean doesn't delete objs.

* Respond to CR feedback.
2019-04-22 14:45:46 -07:00
Simeon 68d769e8ca
Updating versions of various packages. (#83)
Updating versions and fixing a typo in the LottieSamples app.
2019-03-08 15:00:47 -08:00
sohchatt 26b03b2649
README Updates (#65)
- README Improvements + links
- Add Version History
2019-02-19 11:27:27 -08:00
Simeon Cran 2fb63cd38c Fix build break.
Stack.TryPeek() requires .NET Core.
2019-01-03 16:09:24 -08:00
Simeon Cran 74b3f5f1d1 Report parsing and translation issues as warnings rather than errors, unless in strict mode.
Unless strict mode is enabled, we'll report parsing and translation issues as warnings rather than errors so as not to scare users
Add a script to easily install LottieGen from code you build locally.
Remove the GlobalSuppressions.cs files that were not supposed to be there.
Fix some code analysis warnings that were being disabled in the GlobalSuppressions.cs files.
2018-12-05 12:01:24 -08:00
Simeon Cran 10c5f77839 Tweaking the build to make it more sensible. 2018-12-01 17:04:41 -08:00
Simeon Cran e1273a7d06 Make the solution and build look more normal.
We were using configurations to define each build product. That allowed the CI build to build only the projects we want, but it confuses people. So we'll always build everything in CI and go back to Debug and Release configurations only.
Also added a bunch of README content to help people navigate the code.
2018-12-01 17:04:41 -08:00
Simeon Cran a6fc71575f Add a README for the dlls directory.
Seeing as this came up as an Issue question previously, make sure it's answered in the source.
2018-11-30 11:07:55 -08:00
Simeon Cran 8b70a14be7 Ensure types are not public unless building as DLLs. 2018-11-27 18:28:58 -08:00
Simeon Cran a9f40fc831 Revert "Ensure types are not public unless building as DLLs."
This reverts accidental commit 7b75749c87.
2018-11-27 18:00:58 -08:00
Simeon Cran 8e8739cce8 Ensure types are not public unless building as DLLs. 2018-11-27 18:00:58 -08:00
Simeon Cran b014855ed7 Update NuGets, optimize allocations.
Switch to newest JSON parser.
Optimize allocations by using ReadOnlySpan<T> in places where we previously use IEnumerable<T> as a way of protecting arrays for modification.
2018-11-27 18:00:58 -08:00
Simeon Cran d02b78d15b Initial commit of Lottie-Windows source. 2018-11-21 12:18:46 -08:00