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

445 Коммитов

Автор SHA1 Сообщение Дата
Simeon 9aa6344e60
Got some feedback from someone using this README for the first time. (#329)
This should make things a little clearer, especially wrt using LottieGen.exe from a local build without dotnet.exe.
2020-08-06 13:00:19 -07:00
Simeon d8417f9355
Improve naming of the _lottieFilePath field in LottieFileProcessor. (#330)
In response to a CR of another change.
2020-08-06 11:27:10 -07:00
Simeon 8565408f88
CX classes stopped compiling because it wasn't public. Make it public. (#328)
* CX classes stopped compiling because it wasn't public. Make it public.

Apparently something changed in the way XAML gets info about CX classes - it used to compile but now it won't compile unless the classes are public. Public classes publish their metadata, which is presumably how XAML is now getting info about the classes. This change makes the CX classes always public.
2020-08-05 14:30:14 -07:00
Simeon e1500de1ad
Do not include paths or machine info in generated code. (#327)
This is in response to issue 320, where a user was concerned about LottieGen producing non-deterministic output from a build run on different machines.
With this change, we'll no longer include path information or information about where or when the tool was run, and the only thing special that TestMode will do is remove the tool version from the output.
2020-08-05 13:41:08 -07:00
Simeon 1d46593465
TrimmedAnimatable with IReadOnlyList instead of Sequence can end up with a null reference when checking the length. Fix that. (#325) 2020-08-03 16:05:11 -07:00
Simeon e20d07e2c6
Fix issue with C++ multi-version support. (#324)
We were generating a return after each version check instead of checking all the versions before returning. As a result, we'd only run on the highest supported version.
2020-07-31 16:22:08 -07:00
Simeon af84b4a4cc
Use clearer names for automatically generated color bindings. (#321)
When LottieGen generates color bindings automatically, it creates WinRT properties for each distinct color in the Lottie. The names of these properties were using the descriptive color names which are great for trying to understand code, but they're unnecessarily complex for property names. For example, naming a color AlmostTurquoise_FF123456 is including information about the color that the user doesn't care about. The user simply wants to identify which property is which. So now we just output "Color_XXXXXX" where XXXXXX is a 6 digit hex represenation of the color, ignoring alpha.

This change also fixes a bug I noticed during testing where the enumerators for sliced lists were never created.
2020-07-31 12:47:06 -07:00
Simeon 6620d76aca
Replace ReadOnlySpan with IReadOnlyList. (#319)
IReadOnlyList is more convenient, and ReadOnlySpan wasn't buying us anything except slicing because it was only being used to wrap arrays.
2020-07-27 11:07:42 -07:00
Simeon e46972c51f
Add display of markers to Lottie Viewer. (#316)
* Add display of markers to Lottie Viewer.
And doing a bunch of refactoring to reduce code-behind with the benefit of hindsight.
2020-07-17 18:13:51 -07:00
Simeon 22708644ff
Recognize animation subchannels when discovering non-default properties. (#315)
* Recognize animation subchannels when discovering non-default properties.
This problem has always existed but it didn't matter until we started using subchanel animations for Scale (Scale.X and Scale.Y) in order to support multiple easings.
The issue was that we ask which properties have non-default values by looking at whether the property is set, and whether there is an animation for that property.
But when we find animations for a property we need to ignore the subchannel part of the name (the ".X" part).
2020-07-17 11:38:09 -07:00
Simeon bffd1341f7
Eliminate the ReadOnlySpan from Sequence. (#313)
This has been bugging me for ages. It was an attempt to switch the code over to using Span, but in the end it didn't make thing better, and required extra indirections to get at the items in the sequence.
While I'm here I'm adding some other nice touches, including avoiding copying of arrays when create a sequence, and allowing the creation of a sequence from a single item.
2020-07-15 14:12:48 -07:00
Simeon 979d36af17
Fix rare case name collision in generated code. (#314)
Very rarely the generated code contained name collisions as a result of a name having the same form as a name with a counter suffix, e.g. Rectangle_15 looks like a name with a counter suffix but it might just be a 15x15 rectangle.
We now check for collisions when adding a counter suffix.
2020-07-14 17:49:32 -07:00
Simeon e18ec45465
Support animated vector2/vector3 with easings that differ between channels (#312)
Lottie allows Vector2/Vector3 to have different easings for each channel. When that happens we cannot translate
them as Vector2/Vector3 animations, because WinComp only supports an easing for the whole Vector2/Vector3.
Now we will recognize this case and first translate the AnimatableVector3 to an AnimatableVectorXYZ and
create separate animations for each channel.

This change only supports separate easings in that cases that we've seen in the corpus. Complete support is
a lot more expensive code (i.e. expensive to maintain because it requires a lot of repeating of the same
patterns over and over with slight changes).
Current support includes:
* Size of a shape
* Size of a rectangle
* Radius of an ellipse
* Position of a shape
2020-07-14 17:06:29 -07:00
Marcel Wagner 667576ee09
Improve accessibility of lottie viewer (#311)
* Add UIA names to lottie viewer app
2020-07-13 10:29:23 -07:00
Simeon f41d59937c
Add ability to automatically bind to the colors in a Lottie's palette. (#309)
When enabled with -GenerateColorBindings, LottieGen will create bindings
for each non-animated color it finds in a fill or stroke. This will
allow the colors to be changed at runtime.

This is particularly handy for animations that have a single color such
as those found at https://www.lottieflow.com.

The feature is less flexible than theme property bindings because:
a) it only supports colors
b) it doesn't give the designer much control over which parts of the
animation are bindable.
c) it doesn't allow the designer to choose the names used for the
bindings.

The binding name is the color, so a black color will generate a property
called "ColorBlack".

For single-color Lottie files we could be clever and name the property
"Foreground". I'm not doing that right now because we don't yet know
how the feature will be consumed.
2020-07-10 09:38:01 -07:00
Marcel Wagner 156c530425
Improve accessibility (#310) 2020-07-09 10:34:20 -07:00
Simeon 14b455a556
Convert animated paths to static paths with animated offset where possible. (#308)
This way of translating paths applies rarely, but when it does it solves a couple problems:
1) It enables some animated paths to be rendered on UAP versions < 12.
2) It is more efficient than animating a path.
2020-07-07 17:21:41 -07:00
Simeon ddf4edeb30
Ignore the "ml2" field in Lottie files. (#307)
It's a mystery as to what this field does. It appears to be related to miter limit, but that's already handled by "ml". Some tool is adding it, although BodyMovin importer doesn't seem to know what it is.
2020-07-07 16:37:23 -07:00
Simeon 115d836196
Stop using CompositionRectangleGeometry (#305)
CompositionRectangleGeoemetry doesn't anti-alias correctly. Rounded rectangles with tiny corner radiuses work fine, so use them instead.

Rectangles are expected to be fixed eventually, and when they are we can take advantage of their better (than rounded) perf, but until then they aren't reliable.

And fix a bug in the NodeNamer I found during testing.
2020-07-01 17:05:15 -07:00
Simeon 64cfb7c70f
Fix: LottieGen was not creating constants for scalar theme properties. (#303)
This would cause a compile failure of the generated code because the constant was referenced but never found.
2020-06-30 09:54:52 -07:00
Simeon 3327dff791
Include the offset in the name of a gradient stop. (#301)
This is to make it easier to see from the factory method for a gradient where the gradient stops lie.
I'm adding this because I started investigating why gradient stops are sometimes different from run to run of LottieGen and realized that this change would make reading the generated code easier to help figure out what's going on.
2020-06-30 08:30:53 -07:00
Simeon 69e68ecb76
Update the version of nuget. (#299)
Necessary to start consuming cswinrt.
2020-06-22 14:52:53 -07:00
Simeon d4de7b5400
Ignore the "meta" field in Lottie files. (#298)
Ignore the "meta" field in Lotties.
Previously we would complain that this field is unexpected. It's an object added by the LottieFiles.com plugin. We don't do anything interesting with it yet, but at least we shouldn't frighten the user with a warning.
2020-06-22 14:00:25 -07:00
Simeon a9483cf890
Multi dimensional easing (#284)
Add a CubicBezier type to describe easings and spatial Beziers.
And make the keyframe optimizer not remove adjacent keyframes that have the same value but have non-linear cubic bezier easings.
2020-06-18 13:56:38 -07:00
Simeon 897fdc6cba
Remove the ability to output XML from LottieGen. (#297)
The XML outputs aren't being used by anyone AFAIK. They have a maintenance cost and they unnecessarily increase the number of files we generate during testing which slows down testing.
So I'm removing XML completely. For WinComp the C# outputs are higher fidelity and easier to read. For Lottie the YAML outputs are much easier to read.

These old XML outputs were useful in the early development of this project but they have no value now.
2020-06-18 10:26:42 -07:00
Simeon 47a7ef7900
The test for whether an image was embedded or not was not quite right. Failed on one Lottie file. (#296) 2020-06-18 08:02:54 -07:00
Simeon 7a3adbc6b5
Prevent duplicated keyframe progress (#294)
I found a Lottie file that during translation would generate 2 keyframes at the same progress. That's illegal for Composition.
The Lottie file that triggered this had one path in a geometry group at frame 48 and another in the same group at 48.000000357.

This issue is caused by the fact that we convert unique key frame numbers as doubles to progress values as floats. Floats have less resolution, so if 2 keyframes were really close together then they might end up with identical progress values.

It's also an issue when we group animated paths because the 2 paths might have key frame numbers that are slightly different but end up at the same progress value. As long as we prevent identical progress values that's fine, but if we can be a bit smarter about how we compare frame numbers during grouping we can group more effectively.
2020-06-17 14:52:41 -07:00
Simeon d21f426974
Use null-coalescing compound assignment for caches. (#295)
I didn't know this was possible before. It's neater so let's use it consistenly.
2020-06-16 21:41:25 -07:00
Simeon d8e194d278
Merge the v6.1.0 release to master and start v7.0.0 (#292)
* Release version 6.1.0
* Update version number to 7.0.0-build-{height}
2020-06-15 12:56:22 -07:00
Simeon 3b2b9d18da
Update samples to use 6.1.0 NuGet of LottieGen. (#293) 2020-06-15 12:20:37 -07:00
Simeon 69c23b7c13
Update nuget packages to the latest versions. (#290) 2020-06-12 13:08:13 -07:00
Simeon 8432ee254d
Handle rounded rectangles more accurately (#288)
* Rename to match After Effects and some initial refactoring.
* Correctly support roundness where size and roundness are not animated.
* Handle non-static rounded rectangles better.
* Also fixes a misunderstanding with how animations are stopped in Composition.
2020-06-11 16:18:08 -07:00
Simeon 29682524ff
Handle JsonException thrown from JSON parser. (#286)
We were allowing some exceptions to escape, which would cause a crash of the reader.
2020-06-10 11:14:59 -07:00
Simeon 029aeb1aea
Support reverse drawing direction. (#279)
* Support reverse drawing direction.
2020-06-05 12:59:43 -07:00
Simeon a4ebb3f559
Fixes an issue with a visibility optimization. (#282)
An obvious error in the GraphCompactor could result in visibility staying on for too long.
2020-06-05 12:20:00 -07:00
Simeon e0720089fa
Output keyframe easing information in YAML. (#281) 2020-06-05 11:15:40 -07:00
Simeon 34367ced9b
Simplified factories for some common cases. (#278)
* Simplified factories for some common cases.

This simplifies the codegen for the creation of some objects. This results in smaller
outputs and a slight perf improvement.
2020-06-04 09:56:30 -07:00
Simeon c544e564c6
Make writes to the console transactional where necessary. (#277)
* Make writes to the console transactional where necessary.

The recent output coloring made the problem obvious - when we run Lottiegen over multiple files there are numerous threads that are writing to the console and can interleave their writes.
With this change, the writes that need to be kept together have a way of being kept together.
2020-06-04 08:51:19 -07:00
Simeon 1f911d6a4c
Updating the alias used for muxc types to be consistent with the rest of the toolkit code. (#280) 2020-06-03 18:28:19 -07:00
Simeon 0135d9aa1f
Support reading of drawing direction. (#276)
Drawing direction determines where the path of the shape starts and ends. This matters when trimming the path. I think that if the shape is closed (e.g. an ellipse) and the drawing is in reverse
then the trim start and trim end get swapped. Still trying to figure out all the details.
There will be at least one more change to support drawing direction. This is just to get the
bones of the parsing in place. Following changes will use it during translation.

Note that the enum values don't have descriptive names because I'm not sure what they should be yet.
2020-06-02 11:28:35 -07:00
Simeon a25902bbbc
Refactor KeyFrame api to make callsites a bit clearer. (#275) 2020-06-01 16:21:17 -07:00
Simeon e433a90a28
Handle animated path groups in most cases. (#274) 2020-06-01 14:08:00 -07:00
Simeon efc73205a5
Add color and improved formatting to the output of LottieGen. (#272) 2020-05-29 17:09:55 -07:00
Simeon 616df9abc3
Point to a newer version of the platform for running tests. (#273) 2020-05-28 18:39:48 -07:00
Simeon 96743ddd65
PathGeometry wasn't being canonicalized because it didn't implement GetHashCode(). (#270)
Also, fixing a bug in the NodeNamer that caused it to add leading 0's to object counters unnecessarily when there were exactly 10/100/1000/etc objects.
2020-05-27 15:02:34 -07:00
Simeon a46a0ba205
We were ignoring the "closed" property on paths. (#268)
* We were ignoring the "closed" property on paths.

In most cases, a closed path is simply one that ends where it starts, so we just left all our paths open and relied on After Effects to complete the path.
But that was wrong in some cases - specifically the closing of the path determines whether a miter or an end cap is used where the end meets the start.
2020-05-26 16:02:48 -07:00
Simeon 49d5cdb06c
Improve handling of grouped animated paths. (#265)
* Improve handling of grouped animated paths.

This change will allow some (not very common) cases of grouped animated paths where the animation can be optimized away or ignored.
In the cases it can't be sure that it can handle, it now raises an issue to make it clear that there is a problem.
2020-05-22 12:10:43 -07:00
Simeon 7f00db1a35
Fixing spacing in all mentions of "After Effects". (#262)
At one point we were in a habit of calling it "AfterEffects", which is wrong.
2020-05-20 15:02:54 -07:00
Simeon 9cef49f530
Updating issues docs to integrate old commit. (#260)
* Updating issues docs to integrate old changelist.

Sohum created some changes to these issues docs last year. I'm
using them as inspiration to update our docs, and to deprecate another
issue.
2020-05-19 15:06:49 -07:00
Simeon 3282767d28
Updating samples ready for 6.1 release. (#259)
* Updating samples ready for 6.1 release.
2020-05-19 12:17:37 -07:00