Files
UnrealEngineUWP/Engine/Source/Runtime/AnimGraphRuntime/Public/BoneControllers/AnimNode_SkeletalControlBase.h
Michael Noland 7c0f5172ac Animation: Started moving animation nodes out of Engine into a new AnimGraphRuntime module
- Moved all skeletal control nodes to start out

Upgrade Note: Modules containing custom animation nodes will need to have a dependency on the new "AnimGraphRuntime" module added to their Build.cs file
#codereview lina.halper

[CL 2582755 by Michael Noland in Main branch]
2015-06-10 10:57:15 -04:00

64 lines
2.2 KiB
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
/**
* Abstract base class for a skeletal controller.
* A SkelControl is a module that can modify the position or orientation of a set of bones in a skeletal mesh in some programmatic way.
*/
#pragma once
#include "Animation/AnimNodeBase.h"
#include "Animation/InputScaleBias.h"
#include "AnimNode_SkeletalControlBase.generated.h"
USTRUCT()
struct ANIMGRAPHRUNTIME_API FAnimNode_SkeletalControlBase : public FAnimNode_Base
{
GENERATED_USTRUCT_BODY()
// Input link
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Links)
FComponentSpacePoseLink ComponentPose;
// Current strength of the skeletal control
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Settings, meta=(PinShownByDefault))
mutable float Alpha;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Settings)
FInputScaleBias AlphaScaleBias;
public:
FAnimNode_SkeletalControlBase()
: Alpha(1.0f)
{
}
public:
#if WITH_EDITORONLY_DATA
// forwarded pose data from the wired node which current node's skeletal control is not applied yet
FCSPose<FCompactPose> ForwardedPose;
#endif //#if WITH_EDITORONLY_DATA
// FAnimNode_Base interface
virtual void Initialize(const FAnimationInitializeContext& Context) override;
virtual void CacheBones(const FAnimationCacheBonesContext& Context) override;
virtual void Update(const FAnimationUpdateContext& Context) override;
virtual void EvaluateComponentSpace(FComponentSpacePoseContext& Output) override;
// End of FAnimNode_Base interface
protected:
// Interface for derived skeletal controls to implement
// Evaluate the new component-space transforms for the affected bones.
virtual void EvaluateBoneTransforms(USkeletalMeshComponent* SkelComp, FCSPose<FCompactPose>& MeshBases, TArray<FBoneTransform>& OutBoneTransforms) {}
// return true if it is valid to Evaluate
virtual bool IsValidToEvaluate(const USkeleton* Skeleton, const FBoneContainer& RequiredBones) { return false; }
// initialize any bone references you have
virtual void InitializeBoneReferences(const FBoneContainer& RequiredBones){};
/** Allow base to add info to the node debug output */
void AddDebugNodeData(FString& OutDebugData);
};