Description

It seems that when reimporting a mesh that has added bones we aren't updating the compressed data within the anim sequences to account for the change in indicies of the virtual bones. If a user calls UAnimSequence::GetBoneTransform after reimporting the new mesh they'll hit a crash in AEFPerTrackCompressionCodec::GetBoneAtomTranslation. I've attached a project that allows the issue to be reproduced. Note that the workaround for [Link Removed] has to be applied in order to get past the crash on that ticket before hitting this issue.

Steps to Reproduce
  • Apply the workaround mentioned in [Link Removed]
  • Open Repro_00407082 project (attached)
  • Import Mannequin_StandardBones.fbx from Content dir (import the associated animation as well)
  • Add a virtual bone to the skeleton (in my case I added calf_r to ball_r)
  • Create a character bp and add the mesh and anim sequence as the animation asset
  • In the character bp event graph, add a call to ReproGetBoneTransform from the event tick and setup the inputs
    • Reference the animation asset and your virtual bone name on the bp function
  • Save all
  • Add the character bp to the level and PIE
    • PIE should run as expected
  • Reimport the skeletal mesh from a new mesh (Mannequin_WithPonyTail.fbx)
  • Save all
  • PIE again
    • A crash will occur in AEFPerTrackCompressionCodec::GetBoneAtomTranslation called from UAnimSequence::GetBoneTransform
Callstack

UnrealEditor-Engine-Win64-Debug.dll!AEFPerTrackCompressionCodec::GetBoneAtomTranslation(UE::Math::TTransform<double> & OutAtom, FAnimSequenceDecompressionContext & DecompContext, int TrackIndex) Line 568 C++
UnrealEditor-Engine-Win64-Debug.dll!UAnimCompress_PerTrackCompression::DecompressBone(FAnimSequenceDecompressionContext & DecompContext, int TrackIndex, UE::Math::TTransform<double> & OutAtom) Line 1645 C++
UnrealEditor-Engine-Win64-Debug.dll!UAnimSequence::GetBoneTransform(UE::Math::TTransform<double> & OutAtom, int TrackIndex, float Time, bool bUseRawData) Line 1188 C++
UnrealEditor-Repro_00407082-Win64-Debug.dll!URepro00407082BlueprintLibrary::ReproGetBoneTransform(const USkeletalMeshComponent * SkeletalMeshComponent, const UAnimSequence * AnimSequence, FName BoneName, float Time, UE::Math::TTransform<double> & Pose) Line 51 C++
UnrealEditor-Repro_00407082-Win64-Debug.dll!URepro00407082BlueprintLibrary::execReproGetBoneTransform(UObject * Context, FFrame & Stack, void * const Z_Param__Result) Line 31 C++
UnrealEditor-CoreUObject-Win64-Debug.dll!UObject::execCallMathFunction(UObject * Context, FFrame & Stack, void * const Z_Param__Result) Line 945 C++
UnrealEditor-CoreUObject-Win64-Debug.dll!FFrame::Step(UObject * Context, void * const Z_Param__Result) Line 423 C++
UnrealEditor-CoreUObject-Win64-Debug.dll!ProcessLocalScriptFunction(UObject * Context, FFrame & Stack, void * const Z_Param__Result) Line 1110 C++
UnrealEditor-CoreUObject-Win64-Debug.dll!ProcessScriptFunction<void (_cdecl*)(UObject *,FFrame &,void *)>(UObject * Context, UFunction * Function, FFrame & Stack, void * const Z_Param_Result, void[Image Removed](UObject *, FFrame &, void *) ExecFtor) Line 912 C++
UnrealEditor-CoreUObject-Win64-Debug.dll!ProcessLocalFunction(UObject * Context, UFunction * Fn, FFrame & Stack, void * const Z_Param__Result) Line 1143 C++
UnrealEditor-CoreUObject-Win64-Debug.dll!UObject::execLocalFinalFunction(UObject * Context, FFrame & Stack, void * const Z_Param__Result) Line 2998 C++
UnrealEditor-CoreUObject-Win64-Debug.dll!FFrame::Step(UObject * Context, void * const Z_Param__Result) Line 423 C++
UnrealEditor-CoreUObject-Win64-Debug.dll!ProcessLocalScriptFunction(UObject * Context, FFrame & Stack, void * const Z_Param__Result) Line 1110 C++
UnrealEditor-CoreUObject-Win64-Debug.dll!UObject::ProcessInternal(UObject * Context, FFrame & Stack, void * const Z_Param__Result) Line 1171 C++
UnrealEditor-CoreUObject-Win64-Debug.dll!UFunction::Invoke(UObject * Obj, FFrame & Stack, void * const Z_Param__Result) Line 5912 C++
UnrealEditor-CoreUObject-Win64-Debug.dll!UObject::ProcessEvent(UFunction * Function, void * Parms) Line 2003 C++
UnrealEditor-Engine-Win64-Debug.dll!AActor::ProcessEvent(UFunction * Function, void * Parameters) Line 1030 C++
UnrealEditor-Engine-Win64-Debug.dll!AActor::ReceiveTick(float DeltaSeconds) Line 2054 C++
UnrealEditor-Engine-Win64-Debug.dll!AActor::Tick(float DeltaSeconds) Line 1380 C++
UnrealEditor-Engine-Win64-Debug.dll!AActor::TickActor(float DeltaSeconds, ELevelTick TickType, FActorTickFunction & ThisTickFunction) Line 1360 C++
UnrealEditor-Engine-Win64-Debug.dll!FActorTickFunction::ExecuteTick(float DeltaTime, ELevelTick TickType, ENamedThreads::Type CurrentThread, const TRefCountPtr<FGraphEvent> & MyCompletionGraphEvent) Line 197 C++
UnrealEditor-Engine-Win64-Debug.dll!FTickFunctionTask::DoTask(ENamedThreads::Type CurrentThread, const TRefCountPtr<FGraphEvent> & MyCompletionGraphEvent) Line 287 C++
UnrealEditor-Engine-Win64-Debug.dll!TGraphTask<FTickFunctionTask>::ExecuteTask(TArray<FBaseGraphTask *,TSizedDefaultAllocator<32>> & NewTasks, ENamedThreads::Type CurrentThread, bool bDeleteOnCompletion) Line 977 C++
UnrealEditor-Core-Win64-Debug.dll!FNamedTaskThread::ProcessTasksNamedThread(int QueueIndex, bool bAllowStall) Line 753 C++
UnrealEditor-Core-Win64-Debug.dll!FNamedTaskThread::ProcessTasksUntilQuit(int QueueIndex) Line 642 C++
UnrealEditor-Core-Win64-Debug.dll!FTaskGraphCompatibilityImplementation::ProcessThreadUntilRequestReturn(ENamedThreads::Type CurrentThread) Line 2115 C++
UnrealEditor-Core-Win64-Debug.dll!FTaskGraphCompatibilityImplementation::WaitUntilTasksComplete(const TArray<TRefCountPtr<FGraphEvent>,TSizedInlineAllocator<4,32,TSizedDefaultAllocator<32>>> & Tasks, ENamedThreads::Type CurrentThreadIfKnown) Line 2169 C++
UnrealEditor-Engine-Win64-Debug.dll!FTickTaskSequencer::ReleaseTickGroup(ETickingGroup WorldTickGroup, bool bBlockTillComplete) Line 565 C++
UnrealEditor-Engine-Win64-Debug.dll!FTickTaskManager::RunTickGroup(ETickingGroup Group, bool bBlockTillComplete) Line 1592 C++
UnrealEditor-Engine-Win64-Debug.dll!UWorld::RunTickGroup(ETickingGroup Group, bool bBlockTillComplete) Line 790 C++
UnrealEditor-Engine-Win64-Debug.dll!UWorld::Tick(ELevelTick TickType, float DeltaSeconds) Line 1531 C++
UnrealEditor-UnrealEd-Win64-Debug.dll!UEditorEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 1777 C++
UnrealEditor-UnrealEd-Win64-Debug.dll!UUnrealEdEngine::Tick(float DeltaSeconds, bool bIdleMode) Line 474 C++
UnrealEditor-Win64-Debug.exe!FEngineLoop::Tick() Line 5215 C++
UnrealEditor-Win64-Debug.exe!EngineTick() Line 63 C++
UnrealEditor-Win64-Debug.exe!GuardedMain(const wchar_t * CmdLine) Line 186 C++
UnrealEditor-Win64-Debug.exe!LaunchWindowsStartup(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow, const wchar_t * CmdLine) Line 272 C++
UnrealEditor-Win64-Debug.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * pCmdLine, int nCmdShow) Line 330 C++

Have Comments or More Details?

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

0
Login to Vote

Cannot Reproduce
ComponentUE - Anim - Runtime
Affects Versions5.0
Target Fix5.2
CreatedMar 21, 2022
ResolvedJan 23, 2023
UpdatedFeb 3, 2023