Blending when using LinkAnimClassLayers?

Hello, I am setting up a project to use Anim Class Layers, similar to the Lyra example. I have a base unarmed layer and a pistol armed layer.
The problem is, my pistol idle and walk/run blend space are full-body different from my unarmed idle and walk/run blend space. So when I trigger the call to LinkAnimClassLayers on picking up a pistol, bringing in my pistol animation layers, these just replace the idle and walk/run of my unarmed state and there is a visual pop.
Is there a way to blend in the new anim layers?

1 Like

Not with the layers themself, as far as I know.

But what you can do is link the layers only once a transitional montage/state blends out. that way the layer is already linked by the time it even becomes visible.

Same Idea, but different approach is to use a blend node(regular blend, blend by bool, or whatever your setup requires), and have the blend use an input that doesn’t have the layer at all, then link the layer, and only after linking the layer blending over.

Thanks for the reply. That’s the only way I could find to do it, too - playing a montage, binding to the MontageBlendingOutDelegate, and switching layers then. Unfortunately this only really works for full-body montages and simple animation layer changes. If, for example, you’re running with your unarmed anim layers (blend space) and then try to switch over to a markedly different armed running layer (blend space) it’s going to be hard to hide the pop.

But that’s why I find the Lyra example confusing. If you look at B_WeaponInstanceBase you’ll see that when you pick up a weapon they call LinkAnimClassLayers and then play a Montage of picking up the weapon. And the only reason this doesn’t result in a visual pop in Lyra is because their lower-body animations are all very similar for the various states, and because they’re using Inertialization.

At this point I’m not seeing a lot of benefit to the animation layer approach, simply because there’s no easy way to blend in a new layer.

1 Like

In the Anim Graph under Animation Layers click on the animation layer and then in its details panel try setting the blend time. Make sure to add an inertialization node and it should blend between link animal class layers, including blend spaces.
Found from part right at bottom of this link: Animation Blueprint Blend Nodes in Unreal Engine | Unreal Engine 5.0 Documentation

4 Likes

Actually you are correct, I was troubled by this for a while now
Lyra example also uses this in the ABP_ItemAnimLayersBase class

I found no documentation on that actually provided, so it’s actually really hard to find and comprehend

2 Likes

Thank you man, they put blend time to the linked layers in itembase… Gosh.

Video tutorials on Animation Layer Interface: Animation Layers