Files
UnrealEngineUWP/Engine/Source/Runtime/LiveLinkAnimationCore/Public/LiveLinkInstance.h
aurel cordonnier a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00

69 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Animation/AnimInstanceProxy.h"
#include "Animation/AnimInstance.h"
#include "AnimNode_LiveLinkPose.h"
#include "LiveLinkInstance.generated.h"
class ULiveLinkRetargetAsset;
/** Proxy override for this UAnimInstance-derived class */
USTRUCT()
struct LIVELINKANIMATIONCORE_API FLiveLinkInstanceProxy : public FAnimInstanceProxy
{
public:
friend struct FAnimNode_LiveLinkPose;
GENERATED_BODY()
FLiveLinkInstanceProxy()
{
}
FLiveLinkInstanceProxy(UAnimInstance* InAnimInstance)
: FAnimInstanceProxy(InAnimInstance)
{
}
virtual void Initialize(UAnimInstance* InAnimInstance) override;
virtual void PreUpdate(UAnimInstance* InAnimInstance, float DeltaSeconds) override;
virtual bool Evaluate(FPoseContext& Output) override;
virtual void UpdateAnimationNode(const FAnimationUpdateContext& InContext) override;
UPROPERTY(EditAnywhere, Category = Settings)
FAnimNode_LiveLinkPose PoseNode;
};
UCLASS(transient, NotBlueprintable)
class LIVELINKANIMATIONCORE_API ULiveLinkInstance : public UAnimInstance
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category="Animation|Live Link")
void SetSubject(FLiveLinkSubjectName SubjectName)
{
GetProxyOnGameThread<FLiveLinkInstanceProxy>().PoseNode.LiveLinkSubjectName = SubjectName;
}
UFUNCTION(BlueprintCallable, Category = "Animation|Live Link")
void SetRetargetAsset(TSubclassOf<ULiveLinkRetargetAsset> RetargetAsset)
{
GetProxyOnGameThread<FLiveLinkInstanceProxy>().PoseNode.RetargetAsset = RetargetAsset;
}
protected:
virtual FAnimInstanceProxy* CreateAnimInstanceProxy() override;
virtual void DestroyAnimInstanceProxy(FAnimInstanceProxy* InProxy) override;
// Cache for GC
UPROPERTY(transient)
TObjectPtr<ULiveLinkRetargetAsset> CurrentRetargetAsset;
friend FLiveLinkInstanceProxy;
};