Files
UnrealEngineUWP/Engine/Source/Runtime/LiveLinkAnimationCore/Private/LiveLinkRetargetAsset.cpp
marc audy 311f7464bf Updated ../Engine/Source/Runtime/... to inline gen.cpp files
Before:
3648 unity files
Total CPU Time: 47886.140625 s
Total time in Parallel executor: 498.81 seconds

After:
3548 unity files
Total CPU Time: 46643.828125 s
Total time in Parallel executor: 486.06 seconds

#jira
#preflight

[CL 22173263 by marc audy in ue5-main branch]
2022-09-24 13:57:58 -04:00

54 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "LiveLinkRetargetAsset.h"
#include "Animation/AnimCurveTypes.h"
#include "Animation/AnimTypes.h"
#include "Animation/Skeleton.h"
#include "BonePose.h"
#include "GenericPlatform/GenericPlatformMath.h"
#include "Roles/LiveLinkAnimationTypes.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(LiveLinkRetargetAsset)
ULiveLinkRetargetAsset::ULiveLinkRetargetAsset(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
void ULiveLinkRetargetAsset::ApplyCurveValue(const USkeleton* Skeleton, const FName CurveName, const float CurveValue, FBlendedCurve& OutCurve) const
{
SmartName::UID_Type UID = Skeleton->GetUIDByName(USkeleton::AnimCurveMappingName, CurveName);
if (UID != SmartName::MaxUID)
{
OutCurve.Set(UID, CurveValue);
}
}
void ULiveLinkRetargetAsset::BuildCurveData(const FLiveLinkSkeletonStaticData* InSkeletonData, const FLiveLinkAnimationFrameData* InFrameData, const FCompactPose& InPose, FBlendedCurve& OutCurve) const
{
const USkeleton* Skeleton = InPose.GetBoneContainer().GetSkeletonAsset();
if (InSkeletonData->PropertyNames.Num() == InFrameData->PropertyValues.Num())
{
for (int32 CurveIdx = 0; CurveIdx < InSkeletonData->PropertyNames.Num(); ++CurveIdx)
{
const float Curve = InFrameData->PropertyValues[CurveIdx];
if (FMath::IsFinite(Curve))
{
ApplyCurveValue(Skeleton, InSkeletonData->PropertyNames[CurveIdx], Curve, OutCurve);
}
}
}
}
void ULiveLinkRetargetAsset::BuildCurveData(const TMap<FName, float>& CurveMap, const FCompactPose& InPose, FBlendedCurve& OutCurve) const
{
const USkeleton* Skeleton = InPose.GetBoneContainer().GetSkeletonAsset();
for (const TPair<FName, float>& Pair : CurveMap)
{
ApplyCurveValue(Skeleton, Pair.Key, Pair.Value, OutCurve);
}
}