Sequencer Animation Release Stomps linked layers

In 5.7, the following change was made in FPreAnimatedSkeletalAnimationTraits::RestorePreAnimatedValue

[Image Removed]

The problem with this is that InitializeAnimScriptInstance, with the force flag, is that is stomps the linked anim instances, if you are using this feature, when it calls ResetLinkedAnimInstances();

[Image Removed]

This change means that actors released from the sequencer basically have their animation state stomped, if you are using linked anim instances. Lyra uses this approach for instance for layering in the weapon specific animation sets, and link them using LinkAnimClassLayers/UnlinkAnimClassLayers. So if you do anything similar, and you pair that approach with any runtime sequencer control for an actor like this, releasing from the sequencer will stomp this state.

What is the expectation to preserve state through destructive operation like a reinitialize of the anim instance like this?

[Attachment Removed]

Hey there,

We’ve addressed this in CL: 48411317 on mainline or https://github.com/EpicGames/UnrealEngine/commit/2ce1027c56ce08159fefb7a19f664ea673e01bb1

Dustin

[Attachment Removed]

The solution I came up with is to cache the linked anim classes on my derived UAnimInstance class, and reapply them in in a NativeLinkedAnimationLayersInitialized function override, so they get re-applied after the reset.

This seems to make the most sense, but it seems a fair question to users that encounter this in the future to ask why detaching from the sequencer is now so destructive to the animation state of the actor. I would not expect this to occur, as a user, and up until 5.7, it didn’t.

[Attachment Removed]

So during development of 5.7 there was a fix to handle cases where montages wouldn’t continue to play from their cached state after leaving a sequence and the knock on effect was that linked layer state was reinitialized every time. We didn’t catch the case you’ve raised until now and its a bug from that change. This happens from time to time and while we caught post release of 5.7, the spirit of the change was to address a different issue.

[Attachment Removed]

I understand. It’s really impossible to ensure forward progress doesn’t occasionally introduce regressions. I appreciate the quick response. Thanks!

[Attachment Removed]