Files
UnrealEngineUWP/Engine/Source/Runtime/AnimGraphRuntime/Public/SequencePlayerLibrary.h
Thomas Sarkanen e94f925f48 Added more library functions for sequence players/evaluators
Fixed execution context conversion & added BP-exposed conversion funcitons

#rb Jurre.deBaare

[CL 16739992 by Thomas Sarkanen in ue5-main branch]
2021-06-22 04:50:11 -04:00

54 lines
2.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Animation/AnimExecutionContext.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "Animation/AnimNodeReference.h"
#include "SequencePlayerLibrary.generated.h"
struct FAnimNode_SequencePlayer;
USTRUCT(BlueprintType)
struct FSequencePlayerReference : public FAnimNodeReference
{
GENERATED_BODY()
typedef FAnimNode_SequencePlayer FInternalNodeType;
};
// Exposes operations to be performed on a sequence player anim node
// Note: Experimental and subject to change!
UCLASS(Experimental)
class ANIMGRAPHRUNTIME_API USequencePlayerLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
/** Get a sequence player context from an anim node context */
UFUNCTION(BlueprintCallable, Category = "Sequence Player", meta=(BlueprintThreadSafe, ExpandEnumAsExecs = "Result"))
static FSequencePlayerReference ConvertToSequencePlayerContext(const FAnimNodeReference& Node, EAnimNodeReferenceConversionResult& Result);
/** Set the current accumulated time of the sequence player */
UFUNCTION(BlueprintCallable, Category = "Sequence Player", meta=(BlueprintThreadSafe))
static FSequencePlayerReference SetAccumulatedTime(const FSequencePlayerReference& SequencePlayer, float Time);
/** Set the start position of the sequence player */
UFUNCTION(BlueprintCallable, Category = "Sequence Player", meta=(BlueprintThreadSafe))
static FSequencePlayerReference SetStartPosition(const FSequencePlayerReference& SequencePlayer, float StartPosition);
/** Set the play rate of the sequence player */
UFUNCTION(BlueprintCallable, Category = "Sequence Player", meta=(BlueprintThreadSafe))
static FSequencePlayerReference SetPlayRate(const FSequencePlayerReference& SequencePlayer, float PlayRate);
/** Set the current sequence of the sequence player */
UFUNCTION(BlueprintCallable, Category = "Sequence Player", meta=(BlueprintThreadSafe))
static FSequencePlayerReference SetSequence(const FSequencePlayerReference& SequencePlayer, UAnimSequenceBase* Sequence);
/** Set the current sequence of the sequence player with an inertial blend time */
UFUNCTION(BlueprintCallable, Category = "Sequence Player", meta=(BlueprintThreadSafe))
static FSequencePlayerReference SetSequenceWithInertialBlending(const FAnimUpdateContext& UpdateContext, const FSequencePlayerReference& SequencePlayer, UAnimSequenceBase* Sequence, float BlendTime = 0.2f);
};