Files
UnrealEngineUWP/Engine/Source/Runtime/AnimGraphRuntime/Public/SkeletalControlLibrary.h
Thomas Sarkanen d27540628c Skeletal control BP function library
Also fixes type conversions (first time I have tried to convert to a base class and found that my IsChildOf check was the wrong way around).
Plus some extra accessors added for exec/update contexts.
Found the need for these when doing show & tell prep.

#rb Jurre.deBaare

[CL 17367354 by Thomas Sarkanen in ue5-main branch]
2021-08-31 09:30:01 -04:00

49 lines
1.9 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "Animation/AnimNodeReference.h"
#include "SkeletalControlLibrary.generated.h"
struct FAnimNode_SkeletalControlBase;
USTRUCT(BlueprintType)
struct FSkeletalControlReference : public FAnimNodeReference
{
GENERATED_BODY()
typedef FAnimNode_SkeletalControlBase FInternalNodeType;
};
// Exposes operations to be performed on a skeletal control anim node
// Note: Experimental and subject to change!
UCLASS(Experimental)
class ANIMGRAPHRUNTIME_API USkeletalControlLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
/** Get a skeletal control from an anim node */
UFUNCTION(BlueprintCallable, Category = "Skeletal Control", meta=(BlueprintThreadSafe, ExpandEnumAsExecs = "Result"))
static FSkeletalControlReference ConvertToSkeletalControl(const FAnimNodeReference& Node, EAnimNodeReferenceConversionResult& Result);
/** Get a skeletal control from an anim node (pure) */
UFUNCTION(BlueprintPure, Category = "Skeletal Control", meta=(BlueprintThreadSafe, DisplayName = "Convert to Skeletal Control"))
static void ConvertToSkeletalControlPure(const FAnimNodeReference& Node, FSkeletalControlReference& SkeletalControl, bool& Result)
{
EAnimNodeReferenceConversionResult ConversionResult;
SkeletalControl = ConvertToSkeletalControl(Node, ConversionResult);
Result = (ConversionResult == EAnimNodeReferenceConversionResult::Succeeded);
}
/** Set the alpha value of this skeletal control */
UFUNCTION(BlueprintCallable, Category = "Skeletal Control", meta=(BlueprintThreadSafe))
static FSkeletalControlReference SetAlpha(const FSkeletalControlReference& SkeletalControl, float Alpha);
/** Get the alpha value of this skeletal control */
UFUNCTION(BlueprintPure, Category = "Skeletal Control", meta=(BlueprintThreadSafe))
static float GetAlpha(const FSkeletalControlReference& SkeletalControl);
};