UDebugSkelMeshComponent and PreviewInstance are lost current animation asset.

There are 2 ways to fix below

void UDebugSkelMeshComponent::InitAnim(bool bForceReinit)
	// If we already have PreviewInstnace and its asset's Skeleton does not match with mesh's Skeleton
	// then we need to clear it up to avoid an issue
	if ( PreviewInstance && PreviewInstance->GetCurrentAsset() && SkeletalMesh )
		if ( PreviewInstance->GetCurrentAsset()->GetSkeleton() != SkeletalMesh->Skeleton )
			// if it doesn't match, just clear it

#if 0
	if (PreviewInstance != nullptr && AnimScriptInstance == PreviewInstance && bForceReinit)
	if (PreviewInstance != nullptr && bForceReinit)
		// Reset current animation data



	for (UObject* Obj : ObjectsReplaced)
		UObject** NewObject = OldToNewInstanceMap.Find(Obj);
		if (NewObject && *NewObject)
			if (UAnimInstance* AnimTree = Cast<UAnimInstance>(*NewObject))
				// Initialising the anim instance isn't enough to correctly set up the skeletal mesh again in a
				// paused world, need to initialise the skeletal mesh component that contains the anim instance.
				if (USkeletalMeshComponent* SkelComponent = Cast<USkeletalMeshComponent>(AnimTree->GetOuter()))
//					SkelComponent->ClearAnimScriptInstance(); // remove
					// compile change ignores motion vector, so ignore this. 

The easiest workaround is to reopen the preview window and reset the current animation.

Steps to Reproduce
  1. open attached project on 4.22 [Link Removed]
  2. click /Content/Mannequin/Animations/ThirdPersonRun in content browser to open animation preview
  3. click /Content/Mannequin/Animations/PostAnimBP in content browser
  4. reconnect a node in animgraph in PostAnimBP to make BP dirty
  5. compile PostAnimBP
  6. see animation preview window


A mannequin loses a running animation in animation preview.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-96266 in the post.

Login to Vote

ComponentUE - Anim - Runtime - Anim Blueprints
Affects Versions4.
Target Fix5.1
Fix Commit20278272
Main Commit20282219
CreatedAug 3, 2020
ResolvedMay 19, 2022
UpdatedMay 28, 2022
View Jira Issue