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

445 Коммитов

Автор SHA1 Сообщение Дата
Simeon cac5a2f4b6
Getting Lottie metadata piped through. (#195)
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>().
2019-12-03 14:48:57 -08:00
Simeon 62becd2eb8
Adding a metadata facility to CompositionObject. (#194)
* 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.
2019-12-02 13:32:21 -08:00
Simeon 0120656b92
Remove workaround for CompositionRectangleGeometry when running on UAP v8. (#193)
* Remove workaround for CompositionRectangleGeometry when running on UAP v8.

* CR feedback.
2019-11-22 09:47:54 -08:00
Simeon 233959d8aa
Make the DGML format show the links between matte/mask trees and the main visual tree. (#192) 2019-11-21 17:08:50 -08:00
Simeon 95145b481b
Add a cast to eliminate a compiler warning. (#191)
* 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.
2019-11-21 15:32:01 -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 a1d20714b5
Merge6.0.0 into main and start6.1.0 (#187)
* Remove pfx cert from LottieSamples

* Remove pfx cert from LottieViewer
2019-11-15 16:39:36 -08:00
Simeon a5ee89e810
Update the LottieGen readme to refer to 6.0.0 and 6.1.0 now that they're the latest versions. (#189) 2019-11-15 14:06:54 -08:00
sohchatt 969ef525ef Update readme and version history for v6.0 (#188)
* Update README.md

* Update VERSION_HISTORY.md

* Update VERSION_HISTORY.md
2019-11-15 10:49:05 -08:00
Simeon 0297d549ba
Add support for WUC Vector4KeyFrameAnimation. (#186)
* Add support for WUC Vector4KeyFrameAnimation.

This is a prerequisite for supporting opacity and color animated at the same time on the same object.
2019-11-15 09:53:06 -08:00
Simeon 6c210f0c8a
Use the most precise version of "next float". (#185)
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.
2019-11-14 11:15:44 -08:00
Simeon be3ca7c5b7
Fix bug where combining of strokes could fail during translation. (#184)
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.
2019-11-13 10:52:21 -08:00
Simeon 94fc21cd83
Support gradient opacity stops. (#182)
* 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.
2019-11-12 17:08:55 -08:00
Simeon d0df8a8187
Add support for gradient strokes. (#181)
* 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.
2019-11-06 11:52:47 -08:00
Simeon 9928d5ec25
Enable Arm64 builds (#179)
* Enable ARM64 builds.

* More.

* Updating Win2d version. 1.24 is needed to support ARM64.

* Remove person's alias that leaked into the appx package.
2019-11-01 11:42:52 -07:00
Simeon 59ae4598d6
Ensure node names don't conflict with type names for C++. (#177)
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.
2019-10-30 16:09:23 -07:00
Simeon f2a026ce8f
Anti-alias the edges of masks and mattes for a smoother result. (#176)
* 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.
2019-10-29 21:52:59 -07:00
Simeon d39062f746
Handle the case of AnimatedVisuals for different versions needing different parameters. (#170)
Includes some refactoring that made it easier for me to figure out what the generators are doing, and some cleanup.
2019-10-29 10:11:00 -07:00
Simeon b100624947
Optimize calls to CompositionVisualSurface.SourceOffset and .SourceSize. (#169)
Do not set CompositionVisualSurface.SourceOffset or CompositionVisualSurface.SourceSize if they are being set to their default values.
2019-10-28 14:07:28 -07:00
Simeon 33f93f3310
Fix incorrect class name in constructor calls in CX codegen. (#168)
Fix issue #160 - use of Microsoft::WRL namespace was not synced with include of <wrl.h>
2019-10-28 12:19:18 -07:00
Simeon 1a87b8d6fa
Generate version-dependent code. (#165)
Support codegen of multiple versions to allow runtime switching based on the current platform.
2019-10-28 10:49:42 -07:00
Simeon 98cba02414
Add Scott as a code owner so he gets on the CR list for each PR. (#166) 2019-10-25 23:21:53 -07:00
Simeon 0ce4716e33
Define a more sensible sorting order for elements in codegen (#163)
* 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.
2019-10-24 13:20:54 -07: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
Simeon fe31ae01fd
Ensure storage is allocated for the root node in codegen. (#162)
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.
2019-10-23 16:02:57 -07:00
Simeon c2cf5396f8
Refactor codegen to output multiple versions. (#159)
* 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.
2019-10-23 11:30:34 -07:00
Simeon 2a7eb97b52
Versioning stage 2. Translate multiple times to support multiple UAP versions. (#157)
* 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.
2019-10-21 11:38:14 -07:00
Simeon bce52d5d86
Prerequisites for versioning. (#156)
* 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.
2019-10-16 15:32:20 -07:00
Simeon 60a987f463
Improve many masks cases, especially combinations of Add and Subtract… (#154)
* Improve many masks cases, especially combinations of Add and Subtract masks.

* CR feedback.

* CR feedback. Improves some comments.
2019-09-17 17:32:55 -07:00
Simeon 48471c1dde
Add metadata to the WinCompData types to indicate at which UAP version they were introduced. (#155)
This is the first part of rendering Lottie files in a version dependent or version tolerant way.
2019-09-17 15:40:06 -07:00
Simeon 6ca8742c4f
Give more info in the gradient fill issue messages. (#153) 2019-09-11 11:36:20 -07:00
Simeon 6e94ea343d
Support for common radial gradient fills. (#152)
* Support for common radial gradient fills.

* CR feedback.
2019-09-09 09:56:47 -07:00
Simeon b6b29b22e4
We were turning off opacity incorrectly in the case of masks on a shape layer. (#151) 2019-09-06 11:02:02 -07:00
Simeon 43fd94d977
Remove class name option (#150)
* 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.
2019-09-05 18:31:55 -07:00
Simeon 2d77ccb946
Harden against some unexpected cases in Lottie json files. (#149)
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.
2019-09-05 16:29:07 -07:00
Simeon b305a19d76
Enable more linear gradient fill cases, including animated linear gradients. (#146)
* 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.
2019-09-05 13:45:30 -07:00
Simeon 030728876a
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.
2019-09-04 16:15:43 -07:00
Simeon 7542ecc6e5
Enabling simple LinearGradientFill cases. (#145) 2019-08-30 09:55:15 -07:00
Simeon c6825c6b08
Enable VisualSurface now that we are using the 1903 SDK. (#144) 2019-08-29 15:14:59 -07:00
Simeon aeb87289e1
Prepare for gradients (#143)
* 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.
2019-08-29 10:03:44 -07:00
Simeon b63fe928b9
Override the default interpolation color space of ColorKeyFrameAnimation to align with After Effects. (#142)
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.
2019-08-23 17:33:39 -07:00
eliezerpMS 5d64e390d2
Updated comment on CompositeVisuals (#139) 2019-08-23 16:27:56 -07:00
Simeon 2ef1868ffb
Make the generated CX classes public. This allows them to be used in XAML. (#138)
Previously we were always instantiating these from code-behind so the visiblity didn't matter. XAML markup use requires that they are public.
2019-07-29 18:10:55 -07:00
Simeon 869f0a9604
Fixing incorrect (didn't compile) CX codegen for geometry groups. (#137) 2019-07-29 16:00:26 -07:00
eliezerpMS 7cdbb40460
Add support for Effects without Win2d for Cpp/Cx (#133)
* 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
2019-07-01 16:58:05 -07:00
plaiMS 9d914e99b8
Merge pull request #134 from windows-toolkit/ImplementIDynamicAnimatedVisualSource
CodeGen IDynamicAnimatedVisualSource for composition with LoadedImageSurface.
2019-06-20 11:28:25 -07:00
plaiMS 0912817a67
Merge branch 'master' into ImplementIDynamicAnimatedVisualSource 2019-06-20 10:48:22 -07:00
Phyllis Lai dc88de8deb Adding WriteCommaSeparatedLines() in CodeBuilder etc. 2019-06-19 16:25:26 -07:00
Phyllis Lai 89401be104 Adding RequiresReadonlyStorage property to ObjectData to handle LoadedImageSurface. 2019-06-19 13:11:30 -07:00
Phyllis Lai fa9fd78afc More changes per code review feedback. 2019-06-18 16:56:57 -07:00