Files
UnrealEngineUWP/Engine/Source/Runtime/AnimGraphRuntime/Public/LinkedAnimGraphLibrary.h
Thomas Sarkanen 68e1ae10c9 Added pure conversion functions for anim node references
#rb Jurre.deBaare

[CL 16757174 by Thomas Sarkanen in ue5-main branch]
2021-06-23 10:58:34 -04:00

47 lines
2.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "Animation/AnimNodeReference.h"
#include "LinkedAnimGraphLibrary.generated.h"
struct FAnimNode_LinkedAnimGraph;
USTRUCT(BlueprintType)
struct FLinkedAnimGraphReference : public FAnimNodeReference
{
GENERATED_BODY()
typedef FAnimNode_LinkedAnimGraph FInternalNodeType;
};
// Exposes operations to be performed on anim node contexts
UCLASS()
class ANIMGRAPHRUNTIME_API ULinkedAnimGraphLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
/** Get a linked anim graph reference from an anim node reference */
UFUNCTION(BlueprintCallable, Category = "Linked Anim Graph", meta=(BlueprintThreadSafe, ExpandEnumAsExecs = "Result"))
static FLinkedAnimGraphReference ConvertToLinkedAnimGraph(const FAnimNodeReference& Node, EAnimNodeReferenceConversionResult& Result);
/** Get a linked anim graph reference from an anim node reference (pure) */
UFUNCTION(BlueprintPure, Category = "Linked Anim Graph", meta=(BlueprintThreadSafe, DisplayName = "Convert to Linked Anim Graph"))
static void ConvertToLinkedAnimGraphPure(const FAnimNodeReference& Node, FLinkedAnimGraphReference& LinkedAnimGraph, bool& Result)
{
EAnimNodeReferenceConversionResult ConversionResult;
LinkedAnimGraph = ConvertToLinkedAnimGraph(Node, ConversionResult);
Result = (ConversionResult == EAnimNodeReferenceConversionResult::Succeeded);
}
/** Returns whether the node hosts an instance (e.g. linked anim graph or layer) */
UFUNCTION(BlueprintPure, Category = "Linked Anim Graph", meta=(BlueprintThreadSafe))
static bool HasLinkedAnimInstance(const FLinkedAnimGraphReference& Node);
/** Get the linked instance is hosted by this node. If the node does not host an instance then HasLinkedAnimInstance will return false */
UFUNCTION(BlueprintPure, Category = "Linked Anim Graph", meta=(BlueprintThreadSafe))
static UAnimInstance* GetLinkedAnimInstance(const FLinkedAnimGraphReference& Node);
};