You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UE-186241 #rb jurre.debaare, jaime.cifuentes #preflight 646c7ddb2c0a5da0dc594dfd [CL 25577526 by lucas dower in ue5-main branch]
50 lines
1.7 KiB
C++
50 lines
1.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "AnimationStateGraphSchema.h"
|
|
#include "AnimationStateGraph.h"
|
|
#include "AnimStateNode.h"
|
|
#include "AnimGraphNode_StateResult.h"
|
|
#define LOCTEXT_NAMESPACE "AnimationStateGraphSchema"
|
|
|
|
|
|
/////////////////////////////////////////////////////
|
|
// UAnimationStateGraphSchema
|
|
|
|
UAnimationStateGraphSchema::UAnimationStateGraphSchema(const FObjectInitializer& ObjectInitializer)
|
|
: Super(ObjectInitializer)
|
|
{
|
|
}
|
|
|
|
void UAnimationStateGraphSchema::CreateDefaultNodesForGraph(UEdGraph& Graph) const
|
|
{
|
|
// Create the result Create
|
|
FGraphNodeCreator<UAnimGraphNode_StateResult> NodeCreator(Graph);
|
|
UAnimGraphNode_StateResult* ResultSinkNode = NodeCreator.CreateNode();
|
|
NodeCreator.Finalize();
|
|
SetNodeMetaData(ResultSinkNode, FNodeMetadata::DefaultGraphNode);
|
|
|
|
UAnimationStateGraph* TypedGraph = CastChecked<UAnimationStateGraph>(&Graph);
|
|
TypedGraph->MyResultNode = ResultSinkNode;
|
|
}
|
|
|
|
void UAnimationStateGraphSchema::GetGraphDisplayInformation(const UEdGraph& Graph, /*out*/ FGraphDisplayInfo& DisplayInfo) const
|
|
{
|
|
DisplayInfo.PlainName = FText::FromString( Graph.GetName() );
|
|
|
|
if (const UAnimStateNode* StateNode = Cast<const UAnimStateNode>(Graph.GetOuter()))
|
|
{
|
|
DisplayInfo.PlainName = FText::Format( LOCTEXT("StateNameGraphTitle", "{0} (state)"), FText::FromString( StateNode->GetStateName() ) );
|
|
}
|
|
|
|
DisplayInfo.DisplayName = DisplayInfo.PlainName;
|
|
DisplayInfo.Tooltip = LOCTEXT("GraphTooltip_StateSchema", "States contain animation graphs that contribute to the state machine's output pose when the state is active");
|
|
}
|
|
|
|
bool UAnimationStateGraphSchema::CanDuplicateGraph(UEdGraph* InSourceGraph) const
|
|
{
|
|
return false;
|
|
}
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|