// 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 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& MeshBases, TArray& 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); };