Files
UnrealEngineUWP/Engine/Source/Runtime/AnimGraphRuntime/Private/AnimNodes/AnimNode_BlendSpaceEvaluator.cpp
Marc Audy 0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00

41 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "AnimNodes/AnimNode_BlendSpaceEvaluator.h"
#include "Animation/BlendSpace.h"
#include "Animation/AnimTrace.h"
/////////////////////////////////////////////////////
// FAnimNode_BlendSpaceEvaluator
FAnimNode_BlendSpaceEvaluator::FAnimNode_BlendSpaceEvaluator()
: FAnimNode_BlendSpacePlayer()
, NormalizedTime(0.f)
{
}
void FAnimNode_BlendSpaceEvaluator::UpdateAssetPlayer(const FAnimationUpdateContext& Context)
{
GetEvaluateGraphExposedInputs().Execute(Context);
InternalTimeAccumulator = FMath::Clamp(NormalizedTime, 0.f, 1.f);
UpdateInternal(Context);
TRACE_ANIM_NODE_VALUE(Context, TEXT("Name"), GetBlendSpace() ? *GetBlendSpace()->GetName() : TEXT("None"));
TRACE_ANIM_NODE_VALUE(Context, TEXT("Blend Space"), GetBlendSpace());
TRACE_ANIM_NODE_VALUE(Context, TEXT("Playback Time"), InternalTimeAccumulator);
}
void FAnimNode_BlendSpaceEvaluator::GatherDebugData(FNodeDebugData& DebugData)
{
DECLARE_SCOPE_HIERARCHICAL_COUNTER_ANIMNODE(GatherDebugData)
FString DebugLine = DebugData.GetNodeName(this);
DebugLine += FString::Printf(TEXT("('%s' Play Time: %.3f)"), *GetBlendSpace()->GetName(), InternalTimeAccumulator);
DebugData.AddDebugItem(DebugLine, true);
}
float FAnimNode_BlendSpaceEvaluator::GetPlayRate() const
{
return 0.0f;
}