Description

For example in cutscenes, the users use FBoneContainer::SetDisableRetargeting to temporarily use a specific shared animation without retargeting. But the function does not work correctly.

We can fix this issue by the following code. Or we can solve their problem if they can change TranslationRetargeting dynamically for each character.

void DecompressPose(FCompactPose& OutPose, const FCompressedAnimSequence& CompressedData, const FAnimExtractContext& ExtractionContext, USkeleton* SourceSkeleton, float SequenceLength, EAnimInterpolationType Interpolation, bool bIsBakedAdditive, const TArray<FTransform>& RetargetTransforms, FName SourceName, const FRootMotionReset& RootMotionReset)
{
...
    if (CompactPoseBoneIndex != INDEX_NONE)
    {
        RotationScalePairs.Add(BoneTrackPair(CompactPoseBoneIndex, TrackIndex));
 
        // edit begin
        // Skip extracting translation component for EBoneTranslationRetargetingMode::Skeleton.
        //switch (TargetSkeleton->GetBoneTranslationRetargetingMode(TargetSkeletonBoneIndex))
        EBoneTranslationRetargetingMode::Type Mode = RequiredBones.GetDisableRetargeting() ? 
            EBoneTranslationRetargetingMode::Type::Animation :
            TargetSkeleton->GetBoneTranslationRetargetingMode(TargetSkeletonBoneIndex);
        switch(Mode)
        // edit end
        {
        case EBoneTranslationRetargetingMode::Animation:
            TranslationPairs.Add(BoneTrackPair(CompactPoseBoneIndex, TrackIndex));
            break;
...
    } 
Steps to Reproduce
  1. Open attached repro proj
  2. Make package
  3. Run the package
  4. Turn ON/OFF checkbox and check the character on the screen 
  • Which the fix :

With the checkbox set, the pose of the character has to be identical to the animation pose (i.e. hair not getting inside the head).

With the check box off, the pose will change from the animation pose and the hair will go inside the head.

  • Without the fix :

result : The pose has the hair inside the head, with and without the check box

I have added two srreen shots showing the difference when it is working and when it is not

Have Comments or More Details?

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

0
Login to Vote

Fixed
ComponentUE - Anim - Runtime
Affects Versions5.05.1
Target Fix5.2
Fix Commit24077870
CreatedJan 4, 2023
ResolvedFeb 13, 2023
UpdatedApr 29, 2023
View Jira Issue