Files
UnrealEngine/Engine/Plugins/Animation/BlendStack/Source/Runtime/Private/BlendStackInputAnimNodeLibrary.cpp
2025-05-18 13:04:45 +08:00

29 lines
1.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "BlendStack/BlendStackInputAnimNodeLibrary.h"
#include "BlendStack/AnimNode_BlendStackInput.h"
#include "BlendStack/AnimNode_BlendStack.h"
FBlendStackInputAnimNodeReference UBlendStackInputAnimNodeLibrary::ConvertToBlendStackInputNode(const FAnimNodeReference& Node, EAnimNodeReferenceConversionResult& Result)
{
return FAnimNodeReference::ConvertToType<FBlendStackInputAnimNodeReference>(Node, Result);
}
void UBlendStackInputAnimNodeLibrary::GetProperties(const FBlendStackInputAnimNodeReference& BlendStackInputNode, UAnimationAsset*& AnimationAsset, float& AccumulatedTime)
{
AnimationAsset = nullptr;
AccumulatedTime = 0.f;
if (const FAnimNode_BlendStackInput* BlendStackInputNodePtr = BlendStackInputNode.GetAnimNodePtr<FAnimNode_BlendStackInput>())
{
if (BlendStackInputNodePtr->Player)
{
if (const FBlendStackAnimPlayer* Player = *BlendStackInputNodePtr->Player)
{
AnimationAsset = Player->GetAnimationAsset();
AccumulatedTime = Player->GetAccumulatedTime();
}
}
}
}