Description

The AnimSingleNodeInstance used in the AnimMontage preview does not consider multiple Slots. The following is a correction code.

void UAnimSingleNodeInstance::SetAnimationAsset(class UAnimationAsset* NewAsset, bool bInIsLooping, float InPlayRate)
{
...
Proxy.ReinitializeSlotNodes();
if ( Montage->SlotAnimTracks.Num() > 0 )
{    	
   // add
   for (int32 i = 0; i < Montage->SlotAnimTracks.Num(); ++i)
   {    		
      Proxy.RegisterSlotNodeWithAnimInstance(Montage->SlotAnimTracks[i].SlotName);    	
   }    	
   Proxy.SetMontagePreviewSlot(Montage->SlotAnimTracks[0].SlotName);
}
Steps to Reproduce
  1. Open attached repro project
  2. Open Content/ThirdPersonCPP/Sample/NewAnimMontage
  3. Enable PreviewSlot of non-default slot ( ex:DefaultGroup.Slot1 )

expect : can confirm running animnotifystate of the anim sequence in log.
result : it does not run.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to AnswerHub just mention UE-119688 in the post.

1
Login to Vote

Unresolved
ComponentUE - Anim - Runtime
Affects Versions4.264.27
Target Fix5.0
CreatedJul 15, 2021
UpdatedSep 23, 2021