You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Blueprint node searching now leverages localized keyword metadata for searching, so searches can now be done in the current langauge and English to find the same nodes. #jira UE-12049 - Using translated editor, Blueprint node search returns differ for English search terms compared to search terms in the current language #codereview justin.sargent [CL 2517785 by Michael Schoell in Main branch]
112 lines
3.2 KiB
C++
112 lines
3.2 KiB
C++
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "AnimGraphPrivatePCH.h"
|
|
#include "AnimationGraphSchema.h"
|
|
#include "AnimGraphNode_BlendSpaceBase.h"
|
|
#include "AnimGraphNode_BlendSpacePlayer.h"
|
|
#include "AnimGraphNode_RotationOffsetBlendSpace.h"
|
|
#include "GraphEditorActions.h"
|
|
|
|
/////////////////////////////////////////////////////
|
|
|
|
// Action to add a sequence player node to the graph
|
|
struct FNewBlendSpacePlayerAction : public FEdGraphSchemaAction_K2NewNode
|
|
{
|
|
FNewBlendSpacePlayerAction(class UBlendSpaceBase* BlendSpace)
|
|
{
|
|
check(BlendSpace);
|
|
|
|
const bool bIsAimOffset = BlendSpace->IsA(UAimOffsetBlendSpace::StaticClass()) || BlendSpace->IsA(UAimOffsetBlendSpace1D::StaticClass());
|
|
if (bIsAimOffset)
|
|
{
|
|
UAnimGraphNode_RotationOffsetBlendSpace* Template = NewObject<UAnimGraphNode_RotationOffsetBlendSpace>();
|
|
Template->Node.BlendSpace = BlendSpace;
|
|
NodeTemplate = Template;
|
|
TooltipDescription = TEXT("Evaluates an aim offset at a particular coordinate to produce a pose");
|
|
}
|
|
else
|
|
{
|
|
UAnimGraphNode_BlendSpacePlayer* Template = NewObject<UAnimGraphNode_BlendSpacePlayer>();
|
|
Template->Node.BlendSpace = BlendSpace;
|
|
NodeTemplate = Template;
|
|
TooltipDescription = TEXT("Evaluates a blend space at a particular coordinate to produce a pose");
|
|
}
|
|
|
|
MenuDescription = NodeTemplate->GetNodeTitle(ENodeTitleType::ListView);
|
|
|
|
Category = TEXT("Animations");
|
|
|
|
// Grab extra keywords
|
|
Keywords = FText::FromString(BlendSpace->GetPathName());
|
|
}
|
|
};
|
|
|
|
/////////////////////////////////////////////////////
|
|
// 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
|
|
{
|
|
UBlendSpaceBase * 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->NumOfDimension == 1) ? 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)
|
|
{
|
|
UBlendSpaceBase * 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);
|
|
}
|