Blendspace does not correctly synchronize when using syncmarkers in samples

Hello,

I noticed a pop on my blend space that happened every time the player would pass a sync marker. After investigation, this happened due to the blendspace player only correctly syncing the samples when in-between sync markers.

For setup, my blendspace contains samples that each have 1 L & 1 R sync marker (in that order). Fulfilling the matching pattern check inside the blendspace.

It seems that inside UAnimSequence::AdvanceMarkerPhaseAsFollower, when using sync markers, animations are only updated when the track is within sync markers, ignoring the sections between:

  • MarkerIndexSpecialValues::AnimationBoundary < — > 1st sync marker (L)
  • Last sync marker (r) < — > MarkerIndexSpecialValues::AnimationBoundary

So it wont synchronize between sync markers and the track boundaries. This source of this seems to happens on the line 4082 and 4148 inside UAnimSequence::AdvanceMarkerPhaseAsFollower for the conditional

// End Validation

// Only reset position if we found valid markers. Otherwise stay where we are to not pop.

if ((PreviousMarker.MarkerIndex != MarkerIndexSpecialValues::Uninitialized) &amp;&amp; (NextMarker.MarkerIndex != MarkerIndexSpecialValues::Uninitialized))

{

CurrentTime = GetCurrentTimeFromMarkers(PreviousMarker, NextMarker, LeaderEndPosition.PositionBetweenMarkers);

}

Swapping over Uninitialized to AnimationBoundary would fix the issue.

[Attachment Removed]

Steps to Reproduce[Attachment Removed]

Hey there,

Can you confirm which version of the engine you are on and whether you have any other engine changes? Currently, in the 5.7 release, we use MarkerIndexSpecialValues::AnimationBoundary in UAnimSequence::AdvanceMarkerPhaseAsFollower for both forward and backward play.

https://github.com/EpicGames/UnrealEngine/blob/dbd4567bb1443f0155e8df4c6118d02f361f73f3/Engine/Source/Runtime/Engine/Private/Animation/AnimSequence.cpp#L4069

https://github.com/EpicGames/UnrealEngine/blob/dbd4567bb1443f0155e8df4c6118d02f361f73f3/Engine/Source/Runtime/Engine/Private/Animation/AnimSequence.cpp#L4137

Dustin

[Attachment Removed]

Hello,

Apologies for any confusion, I seem to have mixed the suggested solution and the problem. I did had a look at the code and it is the same as on the GitHub, we are currently on 5.7.1.

My suggestion was to change

if ((PreviousMarker.MarkerIndex != MarkerIndexSpecialValues::AnimationBoundary) && (NextMarker.MarkerIndex != MarkerIndexSpecialValues::AnimationBoundary))into

if ((PreviousMarker.MarkerIndex != MarkerIndexSpecialValues::Uninitialized) && (NextMarker.MarkerIndex != MarkerIndexSpecialValues::Uninitialized))Threating AnimationBoundary as a valid marker to allow sync during the first and last sync section on a animation.

Kind regards,

Johan

[Attachment Removed]

Ah, gotcha, yep, that looks like a reasonable change. Still chatting with the dev team on if they want to bring it into the main engine, but feel free to do that.

Dustin

[Attachment Removed]