You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
1) Root motion delta flow supported through all anim nodes deriving from FAnimNode_AssetPlayerBase and montages. 2) Stride/Orientation warping feature graph-driven evaluation modes which leverage root motion delta flow (graph-driven slope warping currently disabled). 3) Root motion flow connected to the Animation Warping plugin. 4) Pose Warping test map featuring various motion "styles" connected to pose warping (Motion Matching, Blend Space Graphs/Assets, Sequence Players, Evaluators). #preflight 6092380a58c4790001a3e9b6 #rb aaron.cox, braeden.shosa, thomas.sarkanen #jira none #fyi laurent.delayen [CL 16208667 by koray hagen in ue5-main branch]
104 lines
2.8 KiB
C++
104 lines
2.8 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "AnimGraphNode_BlendSpaceBase.h"
|
|
#include "EdGraphSchema_K2_Actions.h"
|
|
#include "AnimGraphNode_BlendSpacePlayer.h"
|
|
#include "AnimGraphNode_RotationOffsetBlendSpace.h"
|
|
#include "Animation/AimOffsetBlendSpace.h"
|
|
#include "Animation/BlendSpace1D.h"
|
|
#include "Animation/AimOffsetBlendSpace1D.h"
|
|
#include "Animation/AnimRootMotionProvider.h"
|
|
|
|
#define LOCTEXT_NAMESPACE "AnimGraphNode_BlendSpaceBase"
|
|
|
|
/////////////////////////////////////////////////////
|
|
// UAnimGraphNode_BlendSpaceBase
|
|
|
|
UAnimGraphNode_BlendSpaceBase::UAnimGraphNode_BlendSpaceBase(const FObjectInitializer& ObjectInitializer)
|
|
: Super(ObjectInitializer)
|
|
{
|
|
}
|
|
|
|
FLinearColor UAnimGraphNode_BlendSpaceBase::GetNodeTitleColor() const
|
|
{
|
|
return FLinearColor(0.2f, 0.8f, 0.2f);
|
|
}
|
|
|
|
void UAnimGraphNode_BlendSpaceBase::CustomizePinData(UEdGraphPin* Pin, FName SourcePropertyName, int32 ArrayIndex) const
|
|
{
|
|
UBlendSpace * BlendSpace = GetBlendSpace();
|
|
|
|
if (BlendSpace != NULL)
|
|
{
|
|
if (SourcePropertyName == TEXT("X"))
|
|
{
|
|
Pin->PinFriendlyName = FText::FromString(BlendSpace->GetBlendParameter(0).DisplayName);
|
|
}
|
|
else if (SourcePropertyName == TEXT("Y"))
|
|
{
|
|
Pin->PinFriendlyName = FText::FromString(BlendSpace->GetBlendParameter(1).DisplayName);
|
|
Pin->bHidden = BlendSpace->IsA<UBlendSpace1D>() ? 1 : 0;
|
|
}
|
|
else if (SourcePropertyName == TEXT("Z"))
|
|
{
|
|
Pin->PinFriendlyName = FText::FromString(BlendSpace->GetBlendParameter(2).DisplayName);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
void UAnimGraphNode_BlendSpaceBase::PreloadRequiredAssets()
|
|
{
|
|
PreloadObject(GetBlendSpace());
|
|
|
|
Super::PreloadRequiredAssets();
|
|
}
|
|
|
|
void UAnimGraphNode_BlendSpaceBase::PostProcessPinName(const UEdGraphPin* Pin, FString& DisplayName) const
|
|
{
|
|
if(Pin->Direction == EGPD_Input)
|
|
{
|
|
UBlendSpace * BlendSpace = GetBlendSpace();
|
|
|
|
if(BlendSpace != NULL)
|
|
{
|
|
if(Pin->PinName == TEXT("X"))
|
|
{
|
|
DisplayName = BlendSpace->GetBlendParameter(0).DisplayName;
|
|
}
|
|
else if(Pin->PinName == TEXT("Y"))
|
|
{
|
|
DisplayName = BlendSpace->GetBlendParameter(1).DisplayName;
|
|
}
|
|
else if(Pin->PinName == TEXT("Z"))
|
|
{
|
|
DisplayName = BlendSpace->GetBlendParameter(2).DisplayName;
|
|
}
|
|
}
|
|
}
|
|
|
|
Super::PostProcessPinName(Pin, DisplayName);
|
|
}
|
|
|
|
void UAnimGraphNode_BlendSpaceBase::GetOutputLinkAttributes(FNodeAttributeArray& OutAttributes) const
|
|
{
|
|
Super::GetOutputLinkAttributes(OutAttributes);
|
|
|
|
if (UE::Anim::IAnimRootMotionProvider::Get())
|
|
{
|
|
OutAttributes.Add(UE::Anim::IAnimRootMotionProvider::RootMotionDeltaAttributeName);
|
|
}
|
|
}
|
|
|
|
FText UAnimGraphNode_BlendSpaceBase::GetMenuCategory() const
|
|
{
|
|
return LOCTEXT("BlendSpaceCategory_Label", "BlendSpaces");
|
|
}
|
|
|
|
bool UAnimGraphNode_BlendSpaceBase::IsAimOffsetBlendSpace(const UClass* BlendSpaceClass)
|
|
{
|
|
return BlendSpaceClass->IsChildOf(UAimOffsetBlendSpace::StaticClass()) ||
|
|
BlendSpaceClass->IsChildOf(UAimOffsetBlendSpace1D::StaticClass());
|
|
}
|
|
|
|
#undef LOCTEXT_NAMESPACE |