Files
UnrealEngineUWP/Engine/Source/Editor/AnimGraph/Private/AnimationStateGraphSchema.cpp
lucas dower 31d0124334 Added missing tooltips for animation state machine schemas
#jira UE-186241
#rb jurre.debaare, jaime.cifuentes
#preflight 646c7ddb2c0a5da0dc594dfd

[CL 25577526 by lucas dower in ue5-main branch]
2023-05-23 05:01:32 -04:00

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