Files
UnrealEngineUWP/Engine/Source/Editor/AnimGraph/Private/AnimPreviewAttacheInstance.cpp
jurre debaare efbc802629 Preview Additional Meshes doesn't copy curves from source skelmesh
#fix ensure that the native copy-pose node inside of AnimPreviewAttacheInstance has the 'Copy Curves' flag set
#jira UE-148236
#rb Thomas.Sarkanen
#preflight 6266bd250634d0904ce276de

#ROBOMERGE-AUTHOR: jurre.debaare
#ROBOMERGE-SOURCE: CL 19917005 in //UE5/Release-5.0/... via CL 19917380
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19917945 by jurre debaare in ue5-main branch]
2022-04-26 07:14:33 -04:00

52 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "AnimPreviewAttacheInstance.h"
#define LOCTEXT_NAMESPACE "AnimPreviewAttacheInstance"
void FAnimPreviewAttacheInstanceProxy::Initialize(UAnimInstance* InAnimInstance)
{
FAnimInstanceProxy::Initialize(InAnimInstance);
FAnimationInitializeContext InitContext(this);
CopyPoseFromMesh.bUseAttachedParent = true;
CopyPoseFromMesh.bCopyCurves = true;
CopyPoseFromMesh.Initialize_AnyThread(InitContext);
}
void FAnimPreviewAttacheInstanceProxy::PreUpdate(UAnimInstance* InAnimInstance, float DeltaSeconds)
{
FAnimInstanceProxy::PreUpdate(InAnimInstance, DeltaSeconds);
CopyPoseFromMesh.PreUpdate(InAnimInstance);
}
void FAnimPreviewAttacheInstanceProxy::UpdateAnimationNode(const FAnimationUpdateContext& InContext)
{
UpdateCounter.Increment();
CopyPoseFromMesh.Update_AnyThread(InContext);
}
bool FAnimPreviewAttacheInstanceProxy::Evaluate(FPoseContext& Output)
{
// we cant evaluate on a worker thread here because of the key delegate needing to be fired
CopyPoseFromMesh.Evaluate_AnyThread(Output);
return true;
}
UAnimPreviewAttacheInstance::UAnimPreviewAttacheInstance(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
RootMotionMode = ERootMotionMode::RootMotionFromEverything;
bUseMultiThreadedAnimationUpdate = false;
}
FAnimInstanceProxy* UAnimPreviewAttacheInstance::CreateAnimInstanceProxy()
{
return new FAnimPreviewAttacheInstanceProxy(this);
}
#undef LOCTEXT_NAMESPACE