2019-12-26 15:33:43 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
2014-03-14 14:13:41 -04:00
2014-04-24 08:49:31 -04:00
# include "AnimationStateGraphSchema.h"
2014-04-24 14:34:01 -04:00
# include "AnimationStateGraph.h"
# include "AnimStateNode.h"
# include "AnimGraphNode_StateResult.h"
2014-03-14 14:13:41 -04:00
# define LOCTEXT_NAMESPACE "AnimationStateGraphSchema"
/////////////////////////////////////////////////////
// UAnimationStateGraphSchema
2014-10-14 10:29:11 -04:00
UAnimationStateGraphSchema : : UAnimationStateGraphSchema ( const FObjectInitializer & ObjectInitializer )
: Super ( ObjectInitializer )
2014-03-14 14:13:41 -04:00
{
}
void UAnimationStateGraphSchema : : CreateDefaultNodesForGraph ( UEdGraph & Graph ) const
{
// Create the result Create
FGraphNodeCreator < UAnimGraphNode_StateResult > NodeCreator ( Graph ) ;
UAnimGraphNode_StateResult * ResultSinkNode = NodeCreator . CreateNode ( ) ;
NodeCreator . Finalize ( ) ;
2014-09-12 18:37:04 -04:00
SetNodeMetaData ( ResultSinkNode , FNodeMetadata : : DefaultGraphNode ) ;
2014-03-14 14:13:41 -04:00
UAnimationStateGraph * TypedGraph = CastChecked < UAnimationStateGraph > ( & Graph ) ;
TypedGraph - > MyResultNode = ResultSinkNode ;
}
void UAnimationStateGraphSchema : : 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 UAnimStateNode * StateNode = Cast < const UAnimStateNode > ( Graph . GetOuter ( ) ) )
{
2014-04-23 18:30:37 -04:00
DisplayInfo . PlainName = FText : : Format ( LOCTEXT ( " StateNameGraphTitle " , " {0} (state) " ) , FText : : FromString ( StateNode - > GetStateName ( ) ) ) ;
2014-03-14 14:13:41 -04:00
}
2014-04-23 18:30:37 -04:00
DisplayInfo . DisplayName = DisplayInfo . PlainName ;
2023-05-23 05:01:32 -04:00
DisplayInfo . Tooltip = LOCTEXT ( " GraphTooltip_StateSchema " , " States contain animation graphs that contribute to the state machine's output pose when the state is active " ) ;
2014-03-14 14:13:41 -04:00
}
2023-05-17 14:09:37 -04:00
bool UAnimationStateGraphSchema : : CanDuplicateGraph ( UEdGraph * InSourceGraph ) const
{
return false ;
}
2014-03-14 14:13:41 -04:00
# undef LOCTEXT_NAMESPACE