Skip to content

[LottieGen] Added IAnimatedVisual2 implementation preview. - #477

Merged
aborziak-ms merged 4 commits into
mainfrom
user/aborziak/api-for-animations-unloading
Feb 16, 2022
Merged

aborziak-ms merged 4 commits into
mainfrom
user/aborziak/api-for-animations-unloading

Conversation

@aborziak-ms

@aborziak-ms aborziak-ms commented Nov 11, 2021 •

Copy link
Copy Markdown
Collaborator

Added implementation of IAnimatedVisual2 interface that is going to be added to xaml controls: microsoft/microsoft-ui-xaml#6268. It is disabled by a boolean flag for now, later we will decide if we want to enable it by default (with version check) or to add a command line argument.

interface IAnimatedVisual2 {
    void InstantiateAnimations(); 
    void DestroyAnimations();
}

We also have to ensure that all the animations have zero keyframes (progress = 0.0) in order to correctly re-instantiate animation states, previously we were discarding some zero keyframes.

@aborziak-ms
aborziak-ms requested a review from a team November 11, 2021 18:39
builder.WriteBreakableLine($"auto result = {_s.New(info.ClassName)}(", CommaSeparate(GetConstructorArguments(info)), ");");
if (_implementIAnimatedVisual2)
{
builder.WriteLine($"result.{InstantiateAnimationsMethod}(0.0f);");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"result.{InstantiateAnimationsMethod}(0.0f)

is it true that a non-zero progress will only be used inside the AnimatedVisualPlayer?

Comment thread source/LottieToWinComp/Transforms.cs Resolved

@raymond-wh-leung raymond-wh-leung left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@raymond-wh-leung raymond-wh-leung left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@aborziak-ms
aborziak-ms merged commit 2e80cf6 into main Feb 16, 2022
@delete-merged-branch
delete-merged-branch Bot deleted the user/aborziak/api-for-animations-unloading branch February 16, 2022 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants