Where is current anim layer loaded in Lyra?

Hi community!

I’m deep diving in the Lyra Project, so many awesome features to learn from! Starting to get a hang of the animation system but there is one big question mark: Animation layers are loaded in on a need per need basis and the ThreadSafeUpdateAnimation function is very cool, but I can’t figure out where the different layers are loaded in? Is it in the Lyra Character c++ class? Or is it somewhere in the blueprints?

As far as I can tell, locomotion animations are fetched from the Cardinal Direction struct based on the current Cardinal Direction Enum inside the ABP_ItemAnimLayerBase, and then it loads whatever current animation sequence, existing in that struct, that is in the current anim layer through the FullBody_CycleState layer, which in turn runs the UpdateCycleAnim function. But that only determines which directional animation is supposed to run, not if it’s "rifle jog, “pistol jog” or “unarmed jog” etc. Where is that logic?

Thank you in advance!

2 Likes

OP any chance you have found the solution for this?
I was wondering the same thing.

** Edit ** 1 hour later :melting_face:

If anyone else is trying to find this out, I opened up ABP_UnarmedAnimLayers in the Reference Viewer to see where it was being called.

On the left, you can see where it’s being referenced.
B_Hero_Arena is referenced inside of the plugin folder which is possibly why it has been harder to track down if you weren’t already aware this is where the shooter game logic is being stored.

Here the Unarmed Anim Layer is being set inside of the Construction function inside of the B_Hero_Arena character.

Now the same thing can be done for the weapon layers

Should be straightforward from there, good luck.

5 Likes

Excellent!
I never went further with it because I managed to reconstruct it and build my own logic but I’m glad you found this, more to learn indeed!

1 Like

I have to say this was perplexing me for the longest time as well. I was wondering if I didn’t understand interfaces as well as I did.

So, in summary we create the ItemLayerInterface and populate it with any functions that we want to share across the Items (Like a normal interface blueprint). We then define the base functionality of these functions in our ItemLayerBase anim blueprint. We then can make child blueprints from the base and customize them for the different items.

The MannequinBase anim blueprint inherits the ItemLayerInterface so that we have placeholders to the LinkedLayers to use to further define the logic. Unlike the normal interfaces we didn’t define anything here, just used as a placeholder for the linked layer that we will set during runtime.

Then on the character we can use the node LinkAnimClassLayers to use one of the child ItemLayers ie (Unarmed) and set it on the mesh.

(Keeping It Simple) This could happen at BeginPlay for the character for instance . Could also then be applied when equipping a weapon etc.

It would have been nice if in the Lyra writeup they would have added that little bit of additional explanation. I guess there are a lot of new things going on with Lyra and where do you stop.
Cheers!