2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#include "AnimGraphPrivatePCH.h"
|
2014-04-24 08:49:31 -04:00
|
|
|
#include "AnimationConduitGraphSchema.h"
|
|
|
|
|
#include "AnimGraphNode_TransitionResult.h"
|
|
|
|
|
#include "AnimationTransitionGraph.h"
|
|
|
|
|
#include "AnimStateConduitNode.h"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////
|
|
|
|
|
// UAnimationConduitGraphSchema
|
|
|
|
|
|
2014-10-14 10:29:11 -04:00
|
|
|
UAnimationConduitGraphSchema::UAnimationConduitGraphSchema(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
: Super(ObjectInitializer)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UAnimationConduitGraphSchema::CreateDefaultNodesForGraph(UEdGraph& Graph) const
|
|
|
|
|
{
|
|
|
|
|
FGraphNodeCreator<UAnimGraphNode_TransitionResult> NodeCreator(Graph);
|
|
|
|
|
UAnimGraphNode_TransitionResult* ResultSinkNode = NodeCreator.CreateNode();
|
2014-09-12 18:37:04 -04:00
|
|
|
SetNodeMetaData(ResultSinkNode, FNodeMetadata::DefaultGraphNode);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
UAnimationTransitionGraph* TypedGraph = CastChecked<UAnimationTransitionGraph>(&Graph);
|
|
|
|
|
TypedGraph->MyResultNode = ResultSinkNode;
|
|
|
|
|
|
|
|
|
|
NodeCreator.Finalize();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UAnimationConduitGraphSchema::GetGraphDisplayInformation(const UEdGraph& Graph, /*out*/ FGraphDisplayInfo& DisplayInfo) const
|
|
|
|
|
{
|
2014-04-23 18:30:37 -04:00
|
|
|
DisplayInfo.PlainName = FText::FromString( Graph.GetName() );
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
if (const UAnimStateConduitNode* ConduitNode = Cast<const UAnimStateConduitNode>(Graph.GetOuter()))
|
|
|
|
|
{
|
2014-04-23 18:30:37 -04:00
|
|
|
FFormatNamedArguments Args;
|
|
|
|
|
Args.Add(TEXT("NodeTitle"), ConduitNode->GetNodeTitle(ENodeTitleType::FullTitle) );
|
|
|
|
|
|
|
|
|
|
DisplayInfo.PlainName = FText::Format( NSLOCTEXT("Animation", "ConduitRuleGraphTitle", "{NodeTitle} (conduit rule)"), Args);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
2014-04-23 18:30:37 -04:00
|
|
|
|
|
|
|
|
DisplayInfo.DisplayName = DisplayInfo.PlainName;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|