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

445 Коммитов

Автор SHA1 Сообщение Дата
Simeon Cran d15b5c717a Remove the Badge images. We don't use them.
They were causing certification issues because they had some color in them. But we don't need them because they're only for lock screen notifications, which we don't use.
2020-11-17 16:36:58 -08:00
Nishitha Burman 26a8900fb4 Changed package name, publisher, and package family name 2020-11-17 16:12:58 -08:00
Simeon e881080e07
Start version 7.1. (#388) 2020-11-13 19:07:48 -08:00
Simeon Cran fa182157df Change version number in manifest. 2020-11-13 18:54:21 -08:00
Simeon Cran 3cb37e6313 Change publisher name on BETA version. 2020-11-13 18:31:44 -08:00
Simeon Cran 0fabf01bc8 App packaging was failing for the BETA configuration. Fix that. 2020-11-13 17:57:53 -08:00
Simeon 76cc68e7bd
Don't pretend to handle drop shadows yet. (#386) 2020-11-13 16:38:09 -08:00
Simeon Cran 3090478fc4 Update version.json for 7.0.0-preview4 release. 2020-11-13 15:54:11 -08:00
Simeon b51efec216
Add animation to the Play/Stop button in Lottie Viewer. (#385)
* Add animation to the Play/Stop button in Lottie Viewer.

This also fixes some little issues that I noticed during testing.
2020-11-13 15:12:39 -08:00
Simeon ef29c0374d
Replace -winui3mode with -winuiversion. (#382)
* Replace -winui3mode with -winuiversion.

This will give us more flexibility (e.g. outputing IAnimatedIcon if WinUI 2.5 is being targeted).
2020-11-13 12:36:28 -08:00
Simeon 0c623d2459
Update docs to stop referencing MyGet. (#381)
* Update docs to stop referencing MyGet.

We're now using Azure Devops instead of MyGet for CI builds.
2020-11-13 11:51:45 -08:00
Simeon 9fb254c5a5
Add a new build configuration for a Beta version of LottieViewer. (#380)
* Add a new build configuration for a Beta version of LottieViewer.

The "BETA" build configuration will build LottieViewer with a different name and identity so that it can be released to beta testers and exist side-by-side with the non-beta version.

Add visual assets stamped with "BETA" to make it obvious that it's a BETA.
2020-11-13 10:52:41 -08:00
Simeon 078ad23395
Fix crash on some cases of path groups. (#379)
* Fix crash on some cases of path groups.

As a result of looking again at the algorithm that we use to combine animated paths I decided it needed a lot more documentation and to be rewritten to make sure that we handle all cases.
2020-11-13 09:17:58 -08:00
Simeon ed58095f63
Cleanup: remove redundant type tags. (#378)
* Cleanup: remove redundant type tags.

These type tags evolved a little unevenly. The goal is that the tags represent each of the direct subclasses, but some of the tags were referring to subclasses of subclasses.
2020-11-02 14:49:38 -08:00
Simeon 9ab58d77e6
Parse layer effects. (#377)
* Parse layer effects.

Enable parsing of layer effects. This only fully supports drop shadow effects, however the data model is set up so that other effects can be supported in the future.
2020-10-27 18:49:48 -07:00
Simeon 0589774252
Support .lottie files in LottieGen. (#376)
* Support .lottie files in LottieGen.

See https://dotlottie.io for file details.
LottieGen will now read .lottie files as well as .json files.
2020-10-26 13:46:38 -07:00
Simeon 67c626d0d3
Show the current UAP version in Lottie Viewer. (#375)
Because Lotties can render differently on different UAP versions, it's important that users know what version of UAP they're using. That way, when they say "this doesn't look right", and I say "looks fine to me", we can check the UAP version easily to determine whether that accounts for the difference.
2020-10-23 18:50:43 -07: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 09224fc42b
Cleanup resulting from enabling nullables. (#372)
Replace Asserts that are now handled by nullable analysis.
Add some more "#nullable enable" to quieten code analysis in VS.
Rename a method in CodeBuilder because it referred to Cpp but is now used by C# as well.
2020-10-20 12:05:23 -07:00
Simeon b624e5588f
Code cleanup: take advantage of C# 8 features. (#370)
* Code cleanup: take advantage of C# 8 features.
2020-10-19 17:38:40 -07:00
Simeon aabd953893
Fix codegen errors. (#371)
Fixes needed after first tests on CX since adding the markers and property support.
2020-10-16 20:41:27 -07:00
Simeon d82341b89d
Make the control panels use transitions to slide in and slide out. (#369) 2020-10-16 19:59:03 -07:00
Simeon 2cc4f0c931
Expose overload of SetSourceAsync that takes a stream. (#368)
We always had this overload, however due to a misunderstanding about the rules around overload attributes for WinRT, it was never visible in the WinMD.
This should address #366.
2020-10-16 14:44:53 -07:00
Simeon 1832ef714b
Generate a way to convert between marker names and progress values, a… (#367)
* Generate a way to convert between marker names and progress values, and set bound colors.

To use this without having to cast to a particular class type, use the -AdditionalInterface command line option in LottieGen.

Cppwinrt example:

 LottieGen.exe -inp MyLottieFile -AdditionalInterface MyNamespace.IMyInterface -l cppwinrt

...then in your cppwinrt project, add an IDL file that defines MyNamespace.IMyInterface and declares the methods you want to access, e.g.:

namespace MyNamespace
{
    interface IMyInterface
    {
        Windows.Foundation.Collections.IMapView<String, Double> Markers { get; };

        void SetColorProperty(String propertyName, Windows.UI.Color value);
    };
}

...and finally, reference the interface from your code with an include of "MyNamespace.IMyInterface.h".
2020-10-16 12:13:56 -07:00
Simeon 4303fe9654
Add ability to specify additional interfaces for the generated code. (#365)
* Add ability to specify additional interfaces for the generated code.

This adds a feature to LottieGen to specify interfaces that LottieGen will then claim that the generated class implements.

This feature allows you to access methods that we generated on the class that are not members of IAnimatedVisualSource. This provides a way for us to add new features to the generated code, that can be accessed without knowing the exact type of the generated class, and without us having to update the IAnimatedVisualSource interface.

For example, I am about to add some metadata methods:
  double GetMarkerAsProgress(string markerName);
  void SetColorBinding(string bindingName, Color color);

Cool, but how do you access those methods? If you know the type of the generated class (e.g. "MyCoolLottie") then you can just call the methods on a variable of that type. But what if you want to call one of these methods without knowing the type? Or maybe you want to treat all your generated code in the same way, so the types get in the way.
The solution is to tell LottieGen that the generated code supports an additional interface that you will define to contain the new methods. LottieGen will then say "sure, the generated code implements "MyCoolAdditionalInterface". As long as your interface's methods are the same as the ones that we generate, you'll now be able to use MyCoolAdditionalInterface to call those methods.
2020-10-13 18:16:13 -07:00
Simeon b04e5a0a05
Fully enable nullables. (#363)
* Fully enable nullables.
2020-10-13 10:21:17 -07:00
Simeon e245373a8a
Go back to using latest .NET 3.1 SDK. (#364)
We'd previously had to stick to 3.1.302 due to build issues.
2020-10-09 09:56:22 -07:00
Simeon a79faa9f74
Enable nullable reference types where possible. (#361)
* Enable nullable reference types where possible.

This enables C# 8 nullable reference types. Many files have nullables disabled so I don't have to fix everything at once. I'll get them all enabled bit by bit. All new files default to nullable now.
2020-10-05 18:08:26 -07:00
Simeon ba7ffedc94
Simplifications around image loading, and C++ generated code cleanup. (#360)
* Simplifications around image loading, and C++ generated code cleanup.
2020-10-01 14:11:13 -07:00
Simeon 8b4c3287ff
Fixes a hole in the GraphCompactor optimizer wrt visiblity and masks. (#359)
* Fixes a hole in the GraphCompactor optimizer wrt visiblity and masks.

We use CompositionVisualSurface to implement masks. CompositionVisualSurface allows a Visual tree to be used as a brush, however it ignores many of the properties on the root of the Visual tree it hosts.
The GraphCompactor attempts to push IsVisible animations higher up the tree, however before this fix it could push IsVisible into a Visual that was the root of a CompositionVisualSurface's tree, with the result that the IsVisible property would get ignored.
The fix disallows pushing of IsVisible into a Visual that is at the root of a CompositionVisualSurface's tree.
2020-09-29 17:32:00 -07:00
Simeon f725fbbdc3
Fix rendering issue caused by hole in the optimizer. (#358)
* Fix rendering issue caused by hole in the optimizer.
2020-09-26 13:08:35 -07:00
Simeon f87aa3f5a2
Cppwinrt-consistent file naming (#357)
* cppwinrt codegen refinements.

This is in response to user suggestions:
1. Use non-namespace-qualified names for the names of the *.idl, *.h, *.cpp files. Previously we were qualifying them with namespaces as cppwinrt does, but user preferred non-qualified.
2. Add a -RootNamespace option to LottieGen that corresponds to the same option in cppwinrt.exe. When cppwinrt.exe is given a root namespace, the names of the files it generates has that namespace stripped from them. This option in LottieGen affects the names used in the #includes that include the cppwinrt.exe-generated code.
2020-09-25 14:51:17 -07:00
Simeon 387fdaa858
Fix 2 bugs - path translation optimizer, cppwinrt codegen. (#356)
* Fix 2 bugs - path translation optimizer, cppwinrt codegen.

The path translation optimizer didn't handle the case of paths that consist of single beziers. As a result, some animations were being incorrectly optimized into offset animations.
CppWinrt codegen was instantiating the implementation of CompositeEffect on the stack when it should have been on the heap.
2020-09-24 12:09:46 -07:00
Simeon 0b9501bd37
Get image layer working with cppwinrt. (#354)
* Get image layer working with cppwinrt.

Has some issues if the images are not found, but it works otherwise.
Includes some untested cleaning up of the CX code.
2020-09-23 12:54:57 -07:00
Simeon 0501c70c68
Start on cppwinrt codegen for IDynamicAnimatedVisualSource. (#352)
This is not complete (IDynamicAnimatedVisualSource code will not compile). However it fixes a number of IDynamicAnimatedVisualSource issues.
Also gives unique names to the AnimatedVisual classes. This should make callstacks clearer in C++.
2020-09-22 09:26:13 -07:00
Simeon b8566da91a
Improvements to the CppWinrt code generator. (#350) 2020-09-16 16:42:49 -07:00
Simeon 4988ffe52a
Report expression operation counts. (#345)
* Report expression operation counts.

This information helps humans understand the performance costs of an AnimatedVisual.
2020-09-03 16:51:38 -07:00
Simeon 4a9643fdb3
Change the default for IsAnimatedVisualSourceDynamic. (#346)
This only affects Lotties with non-embedded images. When IsAnimatedVisualSourceDynamic is true the load of the Lottie is not considered complete until all the images have loaded. This guarantees that you never see a Lottie that is missing its images.
When IsAnimatedVisualSourceDynamic is false, the Lottie will load synchronously and the image will pop in when they are finally loaded.
Lotties with non-embedded images are quite rare, and one dev that tried to use them found them to be difficult because they had to wait for the Lottie to be loaded before playing. But they really didn't care about the images taking too long (they were on disk so they should show up really quickly). If we had made IsAnimatedVisualSourceDynamic default to false they wouldn't have had to deal with waiting for the loading and would never have noticed any issue.
So, assuming that most use case are similar (i.e. the images are on disk and there is no need to wait for the images to load), I'm changing the default value false. You can always turn on IsAnimatedVisualSourceDynamic if you need it, but I'm pretty sure hardly anyone ever will.
2020-09-01 14:42:11 -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 62f57788b4
Show animator counts in the object status table in generated code. (#343)
We were showing the number of animation objects previously, but that doesn't really tell you how expensive animations are in DWM because the one animation might be started multiple times. Animator counts are a better representation of cost.

Here's an example of the extra info. Note the animators, and parameters counts.

```// |       Object stats       | UAP v12 count | UAP v8 count |
// |__________________________|_______________|______________|
// | All CompositionObjects   |           567 |          567 |
// |--------------------------+---------------+--------------|
// | Expression animators     |            51 |           51 |
// | KeyFrame animators       |            50 |           50 |
// | Reference parameters     |            51 |           51 |
// |--------------------------+---------------+--------------|
// | Animated brushes         |             1 |            1 |
```
2020-08-31 13:43:46 -07:00
Simeon a5519e86cb
Remove the period from the end of LP0002 so we don't end up with double periods. (#342)
LP0002 is always populated from an exception message, which are supposed to have periods on the end. So most of the time we were getting double periods, which looks bad.
2020-08-28 15:23:33 -07:00
Simeon e504e6c982
Allow JSON to be loaded from any stream, including memory (#341)
* Addressed #333. Allow JSON to be loaded from any stream, including memory.

There was a request (#333) to be able to load Lottie files from memory. This change allows that by enabling any IInputStream to be used.

As part of this change, I found some cruft that I could clean up, and I pulled out the classes for the Loader and ContentFactory and did some other straightforward refactoring.
2020-08-26 14:04:40 -07:00
Simeon 44170b9522
Invalidated IAnimatedVisual on image loading completed, even if it's not successful. (#339)
The code generated for loading an IDynamicAnimatedVisualSource previously only invalidated when all of the images loaded successfully. This means that any failure to load an image would result in the IAnimatedVisual never loading.
With this change, completion of all image loads, even if one of them fails, will invalidate the IDynamicAnimatedVisualSource.
This will allow a Lottie to show up even if one of its images can't load.
2020-08-25 17:38:05 -07:00
Simeon cb215e8537
Fix the namespace for IGeometrySource2D. (#338)
This got broken when we added the WinUI3 switch to LottieGen.
2020-08-25 16:49:24 -07:00
Simeon 8608ab2fd5
Refactor to allow better modularization of the translator. (#337)
* Refactor to allow better modularization of the translator.

Previously most of the translation code had to be in the LottieToWinCompTranslator class and that was making it difficult to maintain.
The goal with this refactor is to allow translation code to be implemented in static methods grouped for convenience into static classes, and to avoid having to pass more than one context to a translation method.

The state that is needed for translation is now in various "contexts". The LottieToWinCompTranslator is now just a static class that creates the top-level context and tells it to translate.
Previously we had a "TranslationContext" that was the context for translating a layer, and a "ShapeContext" that was the context for translating a shape withing a shape layer.
Now we have:
  TranslationContext  - context for stuff that is global to a particular Lottie file's translation.
  CompositionContext  - context for a list of layers. There is a CompositionContext for the root of the Lottie as well as one for each PreComp layer.
  LayerContext        - context for stuff that is layer dependent. There are strongly-typed subclasses of this for each layer type.
  ShapeContext        - as before - context for translating a shape.
These contexts form a hierarchy: ShapeContext contains a LayerContext which contains a CompositionContext which contains a TranslationContext.
Contexts inherit state from their containing context.
Through the magic of implicit conversions, a context can always be passed to a method requiring a context type higher in the hierarchy, e.g. a LayerContext can be passed to a method that requires a TranslationContext.
2020-08-25 14:03:52 -07:00
Simeon 53c52c76c5
Renaming of some methods that return booleans for clarity. (#336)
This was suggested in a previous PR. Actually doing it now.
2020-08-17 15:19:11 -07:00
Simeon bca0aa3aa4
Add a WinUI3 mode to LottieGen. (#331)
This switch is intended to exist only until we fork LottieGen to be WinUI3 only. Until then it is a convenient way to have the code generator output code that needs little hand tweaking to work with WinUI3.
2020-08-17 13:53:36 -07:00
Simeon 777b5e0e73
Stay on .NET SDK 3.1.302. An upgrade to 3.1.401 broke the build. (#335) 2020-08-17 11:38:54 -07:00
Simeon 8d6e56ef3a
Fix translation of rectangles with RoundCorners. (#326)
We were not handling the distinction between RoundCorners.Radius and Rectangle.Roundness. This change does a much better job.
Note that it gets the Trimming wrong for RoundCorners - that will come in a later fix. I'm getting this in now because it has so much refactoring that it will be hard to focus on the trimming algorithm alongside this.

These are the After Effects rules for how RoundCorners.Radius and Rectangle.Roundness interact:
RoundCorners.Radius is ignored if Rectangle.Roundness != 0.
RoundCorners.Radius is able to produce an ellipse if the radius is large enough.
Rectangle.Roundness creates round corners with equal X and Y radii, so it can never create an ellipse.
2020-08-06 15:50:09 -07:00
Simeon 9ddf5e8113
Adding markers to the scrubber. (#318)
* Adding markers to the scrubber.

This is a rewrite of the Scrubber to support markers. It also is a much nicer implementation of the
scrubber that reuses more of the XAML Slider functionality, and reduces the amount of copied XAML from
the default Slider style (from generic.xaml).

As I was adding this change, it became apparent that the way the XAML slider draws its track would
not work well with markers at 0.0 or 1.0 because the track ends up extending before and after the
0.0 and 1.0 positions which would make the markers look like they were incorrectly placed. So now
we do all of the drawing (track, decrease rectangle, and thumb) using Composition.

We also now mimic the mouse-over behavior of Slider so that the control feels a little more engaging.
This required hooking Composition into the VisualStateManager, which is achieved by replacing the
default VisualStateManager with our own implementation.
2020-08-06 13:57:51 -07:00