-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fixed ComposeMatteLayers method to work for invisible layers #479
Conversation
source/LottieToWinComp/Masks.cs
Outdated
{ | ||
// Matte layer is null, which means that it is never visible and LayerMatteType is equal to Invert. | ||
// In this case we should just return mattedVisual because matte layer is effectively a no-op. | ||
yield return new LayerTranslator.FromVisual(mattedVisual); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this what happens in After Effects? (As in if you make the matte inverted and not visible then it just shows the layer to be matted?)
Also should this produce an issue or something? Is there a case where a creator would have done this intentionally (have the matte never show up)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is how it works in AE.
Actually this is a good idea I think, because that is how we discovered this bug, Lottie-Windows produced wrong result but there were no issues to see what exactly is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. Thanks for adding the new issue!
I am thinking though that we probably want the issue to pop up even for the invert no-op case too right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, thx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
translatedLayer.GetVisualRoot
may returnnull
if it detects that layer will not be visible (it has opacity zero, or visible time range is out of parent's time range). If this layer should be matted or should be used as a matte layer it may cause some artifacts to appear.New implementation should be more robust and should handle most corner cases.
mattedLayer
andmatte
are not null -> compose them into one layermattedLayer
isnull
-> skip both layersmatte
layers isnull
-> we can skip them too, (!) except for the case whenMatteType
isInvert
, in this case we are inverting invisible layer which mean that it is always visible, so we should keepmattedLayer