Files
UnrealEngineUWP/Engine/Source/Runtime/AnimGraphRuntime/Public/SequencePlayerLibrary.h
koray hagen dd1c74b2a5 Fixed getter functions for the Sequence Player Library
#jira UE-139605
#rb aaron.cox, jose.villarroel
#preflight 61eb0e9145399e9f5040aa29

#ROBOMERGE-AUTHOR: koray.hagen
#ROBOMERGE-SOURCE: CL 18694698 in //UE5/Release-5.0/... via CL 18694793 via CL 18694807
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18694835 by koray hagen in ue5-main branch]
2022-01-21 15:23:50 -05:00

82 lines
4.1 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 ConvertToSequencePlayer(const FAnimNodeReference& Node, EAnimNodeReferenceConversionResult& Result);
/** Get a sequence player context from an anim node context (pure) */
UFUNCTION(BlueprintPure, Category = "Sequence Player", meta = (BlueprintThreadSafe, DisplayName = "Convert to Sequence Player"))
static void ConvertToSequencePlayerPure(const FAnimNodeReference& Node, FSequencePlayerReference& SequencePlayer, bool& Result)
{
EAnimNodeReferenceConversionResult ConversionResult;
SequencePlayer = ConvertToSequencePlayer(Node, ConversionResult);
Result = (ConversionResult == EAnimNodeReferenceConversionResult::Succeeded);
}
/** 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);
/** Get the current sequence of the sequence player */
UFUNCTION(BlueprintCallable, Category = "Sequence Player", meta = (BlueprintThreadSafe))
static FSequencePlayerReference GetSequence(const FSequencePlayerReference& SequencePlayer, UPARAM(Ref) UAnimSequenceBase*& SequenceBase);
/** Gets the current accumulated time of the sequence player */
UFUNCTION(BlueprintCallable, Category = "Sequence Player", meta = (BlueprintThreadSafe))
static float GetAccumulatedTime(const FSequencePlayerReference& SequencePlayer);
/** Get the start position of the sequence player */
UFUNCTION(BlueprintCallable, Category = "Sequence Player", meta = (BlueprintThreadSafe))
static float GetStartPosition(const FSequencePlayerReference& SequencePlayer);
/** Get the play rate of the sequence player */
UFUNCTION(BlueprintCallable, Category = "Sequence Player", meta = (BlueprintThreadSafe))
static float GetPlayRate(const FSequencePlayerReference& SequencePlayer);
/** Get the looping state of the sequence player */
UFUNCTION(BlueprintCallable, Category = "Sequence Player", meta = (BlueprintThreadSafe))
static bool GetLoopAnimation(const FSequencePlayerReference& SequencePlayer);
};