Skip to content

Enabled shadow effect for PreComp layers - #454

Merged
aborziak-ms merged 3 commits into
masterfrom
user/aborziak/shadow-support
Jul 30, 2021
Merged

aborziak-ms merged 3 commits into
masterfrom
user/aborziak/shadow-support

Conversation

@aborziak-ms

@aborziak-ms aborziak-ms commented Jul 29, 2021 •

Copy link
Copy Markdown
Collaborator

Shadow effect rewritten to use SurfaceBrush. Now there is no more visual glitches.
Also added CompositionMaskBrush since we need it to apply shadow color to the Visual node.

@aborziak-ms
aborziak-ms requested a review from a team July 29, 2021 19:36
Comment thread source/UIData/Tools/GraphCompactor.cs Outdated
Visual? source = ((CompositionVisualSurface)node.Object).SourceVisual;
if (source is not null)
{
graph[source].IsSource = true;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Optimization can merge two ContainerVisuals together if they have common parent. So I decided to mark node that it is used as source of VisualSurface to not optimize it out

Comment thread source/UIData/Tools/GraphCompactor.cs Outdated
// The parent may have been removed already.
let parent = n.Node.Parent
where parent is not null
where parent is not null && !n.Node.IsSource

@eliezerpMS eliezerpMS Jul 29, 2021 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IsSource

If this is only used here could we just do the check we do in Compact here and not have to add the IsSource? #Closed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hm, it is not very clear to me. We can't detect if Visual node was used as Source somewhere else if we didn't walk the graph, right?

Comment thread source/LottieToWinComp/PreComps.cs Resolved
new Vector3(
x: Math.Sin(directionRadians) * distance,
y: Math.Cos(directionRadians) * distance,
y: -Math.Cos(directionRadians) * distance,

@eliezerpMS eliezerpMS Jul 29, 2021 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why negative? Also I am having trouble remembering but I wonder why we have sin for x.... and 1 for z.... I guess I will have to re-review the code.... #Closed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

In AE 0Β° is up, and 90Β° is right. So for 0Β° we need (0, -1) direction vector and (1, 0) for 90Β°

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see. That is strange....

@aborziak-ms aborziak-ms Jul 29, 2021 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think it just an Adobe convention, it is the same in other their apps
In UI it looks like this:
image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah I guess that does make sense from a intuitiveness perspective...

Comment thread source/LottieToWinComp/PreComps.cs Resolved
Comment thread source/LottieToWinComp/PreComps.cs Resolved
Comment thread source/LottieToWinComp/PreComps.cs Resolved
Comment thread source/LottieToWinComp/PreComps.cs Resolved
Comment thread source/UIData/Tools/GraphCompactor.cs Resolved
Comment thread source/LottieToWinComp/PreComps.cs Resolved

@eliezerpMS eliezerpMS left a comment

Copy link
Copy Markdown
Contributor

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 7463321 into master Jul 30, 2021
@delete-merged-branch
delete-merged-branch Bot deleted the user/aborziak/shadow-support branch July 30, 2021 03:37
@aborziak-ms aborziak-ms changed the title Enabled blur effect for PreComp layers Enabled shadow effect for PreComp layers Aug 5, 2021
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