2018-12-14 13:41:00 -05:00
|
|
|
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2014-04-25 02:42:37 -04:00
|
|
|
#include "AnimGraphNode_Root.h"
|
2014-05-20 19:00:53 -04:00
|
|
|
#include "GraphEditorSettings.h"
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////
|
|
|
|
|
// FPoseLinkMappingRecord
|
|
|
|
|
|
|
|
|
|
void FPoseLinkMappingRecord::PatchLinkIndex(uint8* DestinationPtr, int32 LinkID, int32 SourceLinkID) const
|
|
|
|
|
{
|
|
|
|
|
checkSlow(IsValid());
|
|
|
|
|
|
|
|
|
|
DestinationPtr = ChildProperty->ContainerPtrToValuePtr<uint8>(DestinationPtr);
|
|
|
|
|
|
|
|
|
|
if (ChildPropertyIndex != INDEX_NONE)
|
|
|
|
|
{
|
|
|
|
|
UArrayProperty* ArrayProperty = CastChecked<UArrayProperty>(ChildProperty);
|
|
|
|
|
|
|
|
|
|
FScriptArrayHelper ArrayHelper(ArrayProperty, DestinationPtr);
|
|
|
|
|
check(ArrayHelper.IsValidIndex(ChildPropertyIndex));
|
|
|
|
|
|
|
|
|
|
DestinationPtr = ArrayHelper.GetRawPtr(ChildPropertyIndex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check to guard against accidental infinite loops
|
|
|
|
|
check((LinkID == INDEX_NONE) || (LinkID != SourceLinkID));
|
|
|
|
|
|
|
|
|
|
// Patch the pose link
|
|
|
|
|
FPoseLinkBase& PoseLink = *((FPoseLinkBase*)DestinationPtr);
|
|
|
|
|
PoseLink.LinkID = LinkID;
|
|
|
|
|
PoseLink.SourceLinkID = SourceLinkID;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////
|
|
|
|
|
// UAnimGraphNode_Root
|
|
|
|
|
|
2014-04-23 18:30:37 -04:00
|
|
|
#define LOCTEXT_NAMESPACE "A3Nodes"
|
|
|
|
|
|
2014-10-14 10:29:11 -04:00
|
|
|
UAnimGraphNode_Root::UAnimGraphNode_Root(const FObjectInitializer& ObjectInitializer)
|
|
|
|
|
: Super(ObjectInitializer)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FLinearColor UAnimGraphNode_Root::GetNodeTitleColor() const
|
|
|
|
|
{
|
2014-05-20 19:00:53 -04:00
|
|
|
return GetDefault<UGraphEditorSettings>()->ResultNodeTitleColor;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2014-04-23 18:30:37 -04:00
|
|
|
FText UAnimGraphNode_Root::GetNodeTitle(ENodeTitleType::Type TitleType) const
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2019-05-22 12:00:20 -04:00
|
|
|
FText DefaultTitle = LOCTEXT("AnimGraphNodeRoot_Title", "Output Pose");
|
|
|
|
|
|
|
|
|
|
if(TitleType != ENodeTitleType::FullTitle)
|
|
|
|
|
{
|
|
|
|
|
return DefaultTitle;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
FFormatNamedArguments Args;
|
|
|
|
|
Args.Add(TEXT("NodeTitle"), DefaultTitle);
|
|
|
|
|
Args.Add(TEXT("Name"), FText::FromString(GetOuter()->GetName()));
|
|
|
|
|
|
|
|
|
|
return FText::Format(LOCTEXT("AnimGraphNodeRoot_TitleNamed", "{NodeTitle}\n{Name}"), Args);
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2014-09-03 18:14:09 -04:00
|
|
|
FText UAnimGraphNode_Root::GetTooltipText() const
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2019-05-22 12:00:20 -04:00
|
|
|
return LOCTEXT("AnimGraphNodeRoot_Tooltip", "Wire the final animation pose for this graph into this node");
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool UAnimGraphNode_Root::IsSinkNode() const
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2014-08-23 20:16:29 -04:00
|
|
|
void UAnimGraphNode_Root::GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const
|
2014-08-21 18:50:33 -04:00
|
|
|
{
|
|
|
|
|
// Intentionally empty. This node is auto-generated when a new graph is created.
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
FString UAnimGraphNode_Root::GetDocumentationLink() const
|
|
|
|
|
{
|
|
|
|
|
return TEXT("Shared/GraphNodes/AnimationStateMachine");
|
|
|
|
|
}
|
2014-04-23 18:30:37 -04:00
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|