Files
UnrealEngineUWP/Engine/Source/Runtime/AnimGraphRuntime/Public/AnimNodes/AnimNode_ModifyCurve.h
Ryan Vance 7c51ff94af Merging //UE4/Dev-Main to Dev-VR (//UE4/Dev-VR)
CL 1 of 8
#rb integration

[CL 4748712 by Ryan Vance in Dev-VR branch]
2019-01-17 18:54:05 -05:00

68 lines
2.1 KiB
C

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "Animation/AnimNodeBase.h"
#include "AnimNode_ModifyCurve.generated.h"
UENUM()
enum class EModifyCurveApplyMode : uint8
{
/** Add new value to input curve value */
Add,
/** Scale input value by new value */
Scale,
/** Blend input with new curve value, using Alpha setting on the node */
Blend,
/** Blend the new curve value with the last curve value using Alpha to determine the weighting (.5 is a moving average, higher values react to new values faster, lower slower) */
WeightedMovingAverage,
/** Remaps the new curve value between the CurveValues entry and 1.0 (.5 in CurveValues makes 0.51 map to 0.02) */
RemapCurve
};
/** Easy way to modify curve values on a pose */
USTRUCT(BlueprintInternalUseOnly)
struct ANIMGRAPHRUNTIME_API FAnimNode_ModifyCurve : public FAnimNode_Base
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, EditFixedSize, BlueprintReadWrite, Category = Links)
FPoseLink SourcePose;
UPROPERTY(EditAnywhere, BlueprintReadWrite, editfixedsize, Category = ModifyCurve, meta = (PinShownByDefault))
TArray<float> CurveValues;
UPROPERTY()
TArray<FName> CurveNames;
TArray<float> LastCurveValues;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ModifyCurve, meta = (PinShownByDefault))
float Alpha;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = ModifyCurve)
EModifyCurveApplyMode ApplyMode;
FAnimNode_ModifyCurve();
// FAnimNode_Base interface
virtual void Initialize_AnyThread(const FAnimationInitializeContext& Context) override;
virtual void CacheBones_AnyThread(const FAnimationCacheBonesContext& Context) override;
virtual void Evaluate_AnyThread(FPoseContext& Output) override;
virtual void Update_AnyThread(const FAnimationUpdateContext& Context) override;
// End of FAnimNode_Base interface
#if WITH_EDITOR
/** Add new curve being modified */
void AddCurve(const FName& InName, float InValue);
/** Remove a curve from being modified */
void RemoveCurve(int32 PoseIndex);
#endif // WITH_EDITOR
};