Hello!
We noticed that some of our animation assets seemed to change skeletons randomly. We tracked it down to the logic in UAnimationAsset::ReplaceSkeleton. In particular the call to GetAllAnimationSequencesReferred, which causes that function to also change the skeleton on any assets that are referenced.
Here’s a quick repro I did in QAGame in vanilla UE 5.6:
Open the following three skeletons and make them all compatible with each other:
/Game/Characters/UE4_Guy/Mesh/UE4_Mannequin_Skeleton.UE4_Mannequin_Skeleton
/Game/Characters/UE5_Guy/Mannequin_Skeleton.Mannequin_Skeleton
/Game/Characters/Mannequins/Meshes/SK_Mannequin.SK_Mannequin
Make a test montage that uses Mannequin_Skeleton.
Add an animation sequence to that montage that uses SK_Mannequin. E.g. /Game/Characters/Mannequins/Animations/Male_MotionMatch/Walk/MM_relaxed_walk_stop_F_rFoot.MM_relaxed_walk_stop_F_rFoot
In the Content Browser, right click the test montage and choose “Replace Skeleton” and choose UE4_Mannequin_Skeleton.
Notice that the animation sequence will automatically change from SK_Mannequin to UE4_Mannequin_Skeleton.
Question:
- What is the intention of automatically changing the skeleton on all referenced assets? Was the logic in UAnimationAsset::ReplaceSkeleton just implemented before compatible skeletons existed?
- We’re inclined to just remove the logic to replace skeletons on “referred” assets. Can you see any negative consequences to that?
As a bonus test, I added an additional animation sequence to that montage that uses Mannequin_Skeleton: /Game/Characters/UE5_Guy/Animations/A_Mantle_ForDemo.A_Mantle_ForDemo.
At this point, I have a montage that uses animations from two different skeletons, which seems like a reasonable thing to do with Compatible Skeletons. Unfortunately, if I then replace the skeleton of the montage, both animations have their skeletons changed too.
This is a fairly contrived example, but we’ve seen other cases where our build machines (which resave animations semi-nightly) have entered the logic in UAnimationAsset::ReplaceSkeleton and replaced skeletons. Our best guess there is hierarchy changes on the skeleton, but for now we’ve settled with investigating this through the simple repro case above.