AnimNode_NAME.cpp
#include "YOUR_PLUGIN.h"
#include "Runtime/Engine/Public/Animation/AnimInstanceProxy.h"
#include "AnimNode_DataStream.h"
FAnimNode_NAME::FAnimNode_NAME()
{
}
FAnimNode_NAME::~FAnimNode_NAME()
{
}
void FAnimNode_NAME::Initialize(const FAnimationInitializeContext& Context)
{
// Forward to the incoming pose link.
check(Context.AnimInstanceProxy != nullptr);
//init the datastream
InPose.Initialize(Context);
}
TArray<FTransform> inPoses;
void FAnimNode_NAME::Update(const FAnimationUpdateContext& Context)
{
//this function should grab the data that you want on the skeleton and bind it.
//get input skelton Transforms and store
inPoses.Empty();
inPoses = Context.AnimInstanceProxy->GetSkelMeshComponent()->BoneSpaceTransforms;
InPose.Update(Context);
EvaluateGraphExposedInputs.Execute(Context);
}
void FAnimNode_NAME::Evaluate(FPoseContext& Output)
{
check(Output.AnimInstanceProxy->GetSkeleton() != nullptr);
InPose.Evaluate(Output);
//TempBones here is the output pose.
TArray<FTransform> TempBones = Output.Pose.GetBoneContainer().GetRefPoseArray();
TempBones[i].SetLocation(tmpV);
Output.Pose.CopyBonesFrom( TempBones );
return;
}
void FAnimNode_NAME::CacheBones(const FAnimationCacheBonesContext & Context)
{
InPose.CacheBones(Context);
}