2019-12-26 15:33:43 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
|
|
|
#include "AnimationPins/SGraphPinPose.h"
|
2021-01-06 09:11:59 -04:00
|
|
|
#include "AnimGraphNode_Base.h"
|
|
|
|
|
#include "Preferences/PersonaOptions.h"
|
|
|
|
|
#include "AnimGraphAttributes.h"
|
|
|
|
|
#include "Kismet2/BlueprintEditorUtils.h"
|
|
|
|
|
#include "Widgets/Layout/SWrapBox.h"
|
2021-01-11 07:54:28 -04:00
|
|
|
#include "Widgets/Layout/SBorder.h"
|
|
|
|
|
#include "Widgets/Images/SImage.h"
|
|
|
|
|
#include "Widgets/SOverlay.h"
|
|
|
|
|
#include "Widgets/SBoxPanel.h"
|
2021-01-06 09:11:59 -04:00
|
|
|
#include "SGraphPanel.h"
|
|
|
|
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "SGraphPinPose"
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////
|
|
|
|
|
// SGraphPinPose
|
|
|
|
|
|
|
|
|
|
void SGraphPinPose::Construct(const FArguments& InArgs, UEdGraphPin* InPin)
|
|
|
|
|
{
|
|
|
|
|
SGraphPin::Construct(SGraphPin::FArguments(), InPin);
|
|
|
|
|
|
2022-05-09 13:12:28 -04:00
|
|
|
CachedImg_Pin_ConnectedHovered = FAppStyle::GetBrush(TEXT("Graph.PosePin.ConnectedHovered"));
|
|
|
|
|
CachedImg_Pin_Connected = FAppStyle::GetBrush(TEXT("Graph.PosePin.Connected"));
|
|
|
|
|
CachedImg_Pin_DisconnectedHovered = FAppStyle::GetBrush(TEXT("Graph.PosePin.DisconnectedHovered"));
|
|
|
|
|
CachedImg_Pin_Disconnected = FAppStyle::GetBrush(TEXT("Graph.PosePin.Disconnected"));
|
2021-01-06 09:11:59 -04:00
|
|
|
|
|
|
|
|
ReconfigureWidgetForAttributes();
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const FSlateBrush* SGraphPinPose::GetPinIcon() const
|
|
|
|
|
{
|
|
|
|
|
const FSlateBrush* Brush = NULL;
|
|
|
|
|
|
|
|
|
|
if (IsConnected())
|
|
|
|
|
{
|
|
|
|
|
Brush = IsHovered() ? CachedImg_Pin_ConnectedHovered : CachedImg_Pin_Connected;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Brush = IsHovered() ? CachedImg_Pin_DisconnectedHovered : CachedImg_Pin_Disconnected;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Brush;
|
Copying //UE4/Dev-Build to //UE4/Dev-Main (Source: //UE4/Dev-Build @ 3209340)
#lockdown Nick.Penwarden
#rb none
==========================
MAJOR FEATURES + CHANGES
==========================
Change 3209340 on 2016/11/23 by Ben.Marsh
Convert UE4 codebase to an "include what you use" model - where every header just includes the dependencies it needs, rather than every source file including large monolithic headers like Engine.h and UnrealEd.h.
Measured full rebuild times around 2x faster using XGE on Windows, and improvements of 25% or more for incremental builds and full rebuilds on most other platforms.
* Every header now includes everything it needs to compile.
* There's a CoreMinimal.h header that gets you a set of ubiquitous types from Core (eg. FString, FName, TArray, FVector, etc...). Most headers now include this first.
* There's a CoreTypes.h header that sets up primitive UE4 types and build macros (int32, PLATFORM_WIN64, etc...). All headers in Core include this first, as does CoreMinimal.h.
* Every .cpp file includes its matching .h file first.
* This helps validate that each header is including everything it needs to compile.
* No engine code includes a monolithic header such as Engine.h or UnrealEd.h any more.
* You will get a warning if you try to include one of these from the engine. They still exist for compatibility with game projects and do not produce warnings when included there.
* There have only been minor changes to our internal games down to accommodate these changes. The intent is for this to be as seamless as possible.
* No engine code explicitly includes a precompiled header any more.
* We still use PCHs, but they're force-included on the compiler command line by UnrealBuildTool instead. This lets us tune what they contain without breaking any existing include dependencies.
* PCHs are generated by a tool to get a statistical amount of coverage for the source files using it, and I've seeded the new shared PCHs to contain any header included by > 15% of source files.
Tool used to generate this transform is at Engine\Source\Programs\IncludeTool.
[CL 3209342 by Ben Marsh in Main branch]
2016-11-23 15:48:37 -05:00
|
|
|
}
|
2021-01-06 09:11:59 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
enum class EAttributeUsage
|
|
|
|
|
{
|
|
|
|
|
// Attribute is input/output by the pin, but is not currently connected to a producer/consumer
|
|
|
|
|
Unused,
|
|
|
|
|
|
|
|
|
|
// Attribute is input/output by the pin and is currently connected to a producer/consumer
|
|
|
|
|
Used,
|
|
|
|
|
|
|
|
|
|
// Attribute is not an input/output of the pin but passes through the node
|
|
|
|
|
Passthrough,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class SAttributeIndicator : public SCompoundWidget
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
SLATE_BEGIN_ARGS(SAttributeIndicator) {}
|
|
|
|
|
|
|
|
|
|
SLATE_ARGUMENT(FName, Attribute)
|
|
|
|
|
|
|
|
|
|
SLATE_END_ARGS()
|
|
|
|
|
|
2021-01-25 08:43:19 -04:00
|
|
|
void Construct(const FArguments& InArgs, UAnimBlueprint* InAnimBlueprint, const FAnimGraphAttributeDesc* InAttributeDesc, const UEdGraphPin* InPin, EAttributeUsage InUsage, const UAnimGraphNode_Base* InAnimGraphNode)
|
2021-01-06 09:11:59 -04:00
|
|
|
{
|
|
|
|
|
AnimBlueprint = InAnimBlueprint;
|
|
|
|
|
AttributeDesc = InAttributeDesc;
|
|
|
|
|
Pin = InPin;
|
|
|
|
|
Usage = InUsage;
|
|
|
|
|
AnimGraphNode = InAnimGraphNode;
|
|
|
|
|
ActiveColor = AttributeDesc->Color.GetSpecifiedColor();
|
|
|
|
|
Color = ActiveColor;
|
|
|
|
|
Value = 0.0f;
|
|
|
|
|
|
|
|
|
|
ChildSlot
|
|
|
|
|
[
|
2021-05-26 05:09:41 -04:00
|
|
|
SNew(SImage)
|
|
|
|
|
.Visibility_Lambda([this](){ return Value == 0.0f ? EVisibility::Hidden : EVisibility::Visible; })
|
|
|
|
|
.Image(&AttributeDesc->Icon)
|
|
|
|
|
.ColorAndOpacity_Lambda([this](){ return Color; })
|
2021-01-06 09:11:59 -04:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override
|
|
|
|
|
{
|
|
|
|
|
bool bActive = false;
|
|
|
|
|
|
|
|
|
|
if((Usage == EAttributeUsage::Used || AttributeDesc->Blend == EAnimGraphAttributeBlend::Blendable) && AnimBlueprint && AnimBlueprint->GetObjectBeingDebugged() != nullptr)
|
|
|
|
|
{
|
|
|
|
|
UAnimBlueprintGeneratedClass* AnimBlueprintClass = (UAnimBlueprintGeneratedClass*)(*(AnimBlueprint->GeneratedClass));
|
|
|
|
|
int32 SourceNodeId = AnimBlueprintClass->GetNodeIndexFromGuid(AnimGraphNode->NodeGuid);
|
|
|
|
|
if(SourceNodeId != INDEX_NONE)
|
|
|
|
|
{
|
|
|
|
|
const TArray<FAnimBlueprintDebugData::FAttributeRecord>* LinkAttributes;
|
|
|
|
|
if(Pin->Direction == EGPD_Input)
|
|
|
|
|
{
|
|
|
|
|
LinkAttributes = AnimBlueprintClass->GetAnimBlueprintDebugData().NodeInputAttributesThisFrame.Find(SourceNodeId);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LinkAttributes = AnimBlueprintClass->GetAnimBlueprintDebugData().NodeOutputAttributesThisFrame.Find(SourceNodeId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bActive = LinkAttributes && LinkAttributes->ContainsByPredicate([this](const FAnimBlueprintDebugData::FAttributeRecord& InRecord){ return InRecord.Attribute == AttributeDesc->Name; });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(bActive)
|
|
|
|
|
{
|
|
|
|
|
Value = 1.0f;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Value = FMath::FInterpTo(Value, 0.0f, InDeltaTime, 4.0f);
|
|
|
|
|
}
|
2021-05-26 05:09:41 -04:00
|
|
|
|
|
|
|
|
Color = FMath::Lerp(FLinearColor::Transparent, ActiveColor, Value);
|
2021-01-06 09:11:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UAnimBlueprint* AnimBlueprint;
|
|
|
|
|
const FAnimGraphAttributeDesc* AttributeDesc;
|
|
|
|
|
const UEdGraphPin* Pin;
|
|
|
|
|
EAttributeUsage Usage;
|
2021-01-25 08:43:19 -04:00
|
|
|
const UAnimGraphNode_Base* AnimGraphNode;
|
2021-01-06 09:11:59 -04:00
|
|
|
FLinearColor ActiveColor;
|
|
|
|
|
FLinearColor Color;
|
|
|
|
|
float Value;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void SGraphPinPose::ReconfigureWidgetForAttributes()
|
|
|
|
|
{
|
|
|
|
|
AttributeInfos.Empty();
|
|
|
|
|
|
2021-10-12 21:21:22 -04:00
|
|
|
if(UAnimGraphNode_Base* AnimGraphNode = Cast<UAnimGraphNode_Base>(GraphPinObj->GetOwningNode()))
|
2021-01-06 09:11:59 -04:00
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
if(UAnimBlueprint* AnimBlueprint = Cast<UAnimBlueprint>(FBlueprintEditorUtils::FindBlueprintForNode(AnimGraphNode)))
|
2021-01-06 09:11:59 -04:00
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
|
|
|
|
|
auto AddAttributes = [this, AnimBlueprint, AnimGraphNode](TArrayView<const FName> InUsedAttributes, TArrayView<const FName> InUnusedAttributes, TArrayView<const FName> InPassThroughAttributes)
|
2021-01-06 09:11:59 -04:00
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
auto AddAttribute = [this, AnimBlueprint, AnimGraphNode](FName InAttribute, EAttributeUsage InUsage)
|
2021-01-06 09:11:59 -04:00
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
const FAnimGraphAttributeDesc* AttributeDesc = GetDefault<UAnimGraphAttributes>()->FindAttributeDesc(InAttribute);
|
2021-01-25 08:43:19 -04:00
|
|
|
|
2021-10-12 21:21:22 -04:00
|
|
|
// Early out if we don't want to display this attribute
|
|
|
|
|
if(AttributeDesc)
|
2021-01-27 07:24:02 -04:00
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
if(AttributeDesc->DisplayMode == EAnimGraphAttributesDisplayMode::HideOnPins)
|
2021-01-27 07:24:02 -04:00
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
return;
|
|
|
|
|
}
|
2021-01-27 07:24:02 -04:00
|
|
|
|
2021-10-12 21:21:22 -04:00
|
|
|
// Only store cached attributes for wires on used pins
|
|
|
|
|
if(InUsage != EAttributeUsage::Unused)
|
|
|
|
|
{
|
|
|
|
|
AttributeInfos.Emplace(InAttribute, AttributeDesc->Color.GetSpecifiedColor(), AttributeDesc->Blend, AttributeDesc->SortOrder);
|
|
|
|
|
|
|
|
|
|
// Skip displaying passthrough attributes on pins
|
|
|
|
|
if(InUsage != EAttributeUsage::Passthrough && AnimGraphNode->ShouldShowAttributesOnPins())
|
|
|
|
|
{
|
|
|
|
|
const UAnimGraphNode_Base* ProxyGraphNode = AnimGraphNode->GetProxyNodeForAttributes();
|
|
|
|
|
|
|
|
|
|
GetLabelAndValue()->AddSlot()
|
|
|
|
|
.Padding(2.0f, 0.0f, 0.0f, 0.0f)
|
|
|
|
|
[
|
|
|
|
|
SNew(SAttributeIndicator, AnimBlueprint, AttributeDesc, GraphPinObj, InUsage, ProxyGraphNode)
|
|
|
|
|
];
|
|
|
|
|
}
|
2021-01-27 07:24:02 -04:00
|
|
|
}
|
2021-01-06 09:11:59 -04:00
|
|
|
}
|
2021-10-12 21:21:22 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
for(const FName& Attribute : InUsedAttributes)
|
|
|
|
|
{
|
|
|
|
|
AddAttribute(Attribute, EAttributeUsage::Used);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(const FName& Attribute : InUnusedAttributes)
|
|
|
|
|
{
|
|
|
|
|
AddAttribute(Attribute, EAttributeUsage::Unused);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(const FName& Attribute : InPassThroughAttributes)
|
|
|
|
|
{
|
|
|
|
|
AddAttribute(Attribute, EAttributeUsage::Passthrough);
|
2021-01-06 09:11:59 -04:00
|
|
|
}
|
2021-01-27 07:24:02 -04:00
|
|
|
};
|
|
|
|
|
|
2021-10-12 21:21:22 -04:00
|
|
|
UAnimBlueprintGeneratedClass* AnimBlueprintClass = (UAnimBlueprintGeneratedClass*)(*(AnimBlueprint->GeneratedClass));
|
|
|
|
|
|
|
|
|
|
UAnimGraphNode_Base::FNodeAttributeArray PinAttributes;
|
|
|
|
|
switch(GraphPinObj->Direction)
|
2021-01-27 07:24:02 -04:00
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
case EGPD_Input:
|
|
|
|
|
AnimGraphNode->GetInputLinkAttributes(PinAttributes);
|
|
|
|
|
break;
|
|
|
|
|
case EGPD_Output:
|
|
|
|
|
AnimGraphNode->GetOutputLinkAttributes(PinAttributes);
|
|
|
|
|
break;
|
2021-01-27 07:24:02 -04:00
|
|
|
}
|
|
|
|
|
|
2021-10-12 21:21:22 -04:00
|
|
|
UAnimGraphNode_Base::FNodeAttributeArray NodeAttributes;
|
|
|
|
|
AnimGraphNode->GetInputLinkAttributes(NodeAttributes);
|
|
|
|
|
AnimGraphNode->GetOutputLinkAttributes(NodeAttributes);
|
|
|
|
|
|
|
|
|
|
// Unlinked pins display attributes if they are inputs and the node takes them as inputs
|
|
|
|
|
if(GraphPinObj->LinkedTo.Num() == 0)
|
2021-01-27 07:24:02 -04:00
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
AddAttributes(TArrayView<const FName>(), PinAttributes, TArrayView<const FName>());
|
2021-01-27 07:24:02 -04:00
|
|
|
}
|
2021-10-12 21:21:22 -04:00
|
|
|
else if(GraphPinObj->LinkedTo.Num() > 0)
|
2021-01-27 07:24:02 -04:00
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
TArrayView<const FName> CompilerGeneratedAttributes = AnimBlueprintClass->GetAnimBlueprintDebugData().GetNodeAttributes(AnimGraphNode);
|
|
|
|
|
UAnimGraphNode_Base::FNodeAttributeArray UsedAttributes;
|
|
|
|
|
UAnimGraphNode_Base::FNodeAttributeArray UnusedAttributes;
|
|
|
|
|
if(PinAttributes.Num() > 0)
|
2021-01-06 09:11:59 -04:00
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
for(const FName& Name : PinAttributes)
|
2021-01-27 07:24:02 -04:00
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
if(CompilerGeneratedAttributes.Contains(Name))
|
|
|
|
|
{
|
|
|
|
|
UsedAttributes.Add(Name);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
UnusedAttributes.Add(Name);
|
|
|
|
|
}
|
2021-01-27 07:24:02 -04:00
|
|
|
}
|
2021-01-06 09:11:59 -04:00
|
|
|
}
|
|
|
|
|
|
2021-10-12 21:21:22 -04:00
|
|
|
UAnimGraphNode_Base::FNodeAttributeArray PassthroughAttributes;
|
|
|
|
|
for(const FName& Name : CompilerGeneratedAttributes)
|
2021-01-27 07:24:02 -04:00
|
|
|
{
|
2021-10-12 21:21:22 -04:00
|
|
|
if(!PinAttributes.Contains(Name))
|
|
|
|
|
{
|
|
|
|
|
PassthroughAttributes.Add(Name);
|
|
|
|
|
}
|
2021-01-27 07:24:02 -04:00
|
|
|
}
|
2021-10-12 21:21:22 -04:00
|
|
|
|
|
|
|
|
AddAttributes(UsedAttributes, UnusedAttributes, PassthroughAttributes);
|
2021-01-06 09:11:59 -04:00
|
|
|
}
|
2021-01-27 07:24:02 -04:00
|
|
|
|
2021-10-12 21:21:22 -04:00
|
|
|
// sort pin attributes
|
|
|
|
|
Algo::Sort(AttributeInfos, [](const FAttributeInfo& InValue0, const FAttributeInfo& InValue1)
|
|
|
|
|
{
|
|
|
|
|
return InValue0.SortOrder < InValue1.SortOrder;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// overrides attribute set in the base class Construct()
|
|
|
|
|
SetToolTipText(MakeAttributeSP(this, &SGraphPinPose::GetAttributeTooltipText));
|
2021-01-06 09:11:59 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TArrayView<const SGraphPinPose::FAttributeInfo> SGraphPinPose::GetAttributeInfo() const
|
|
|
|
|
{
|
|
|
|
|
SGraphNode* MyOwnerNode = OwnerNodePtr.Pin().Get();
|
|
|
|
|
if (MyOwnerNode && MyOwnerNode->GetOwnerPanel().IsValid())
|
|
|
|
|
{
|
|
|
|
|
if(MyOwnerNode->GetOwnerPanel()->GetCurrentLOD() <= EGraphRenderingLOD::LowDetail)
|
|
|
|
|
{
|
|
|
|
|
return TArrayView<const FAttributeInfo>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return AttributeInfos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float SGraphPinPose::GetZoomAmount() const
|
|
|
|
|
{
|
|
|
|
|
SGraphNode* MyOwnerNode = OwnerNodePtr.Pin().Get();
|
|
|
|
|
if (MyOwnerNode && MyOwnerNode->GetOwnerPanel().IsValid())
|
|
|
|
|
{
|
|
|
|
|
return MyOwnerNode->GetOwnerPanel()->GetZoomAmount();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 1.0f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FText SGraphPinPose::GetAttributeTooltipText() const
|
|
|
|
|
{
|
|
|
|
|
if(GraphPinObj)
|
|
|
|
|
{
|
|
|
|
|
UEdGraphPin* OtherPin = GraphPinObj->LinkedTo.Num() > 0 ? GraphPinObj->LinkedTo[0] : nullptr;
|
|
|
|
|
if(OtherPin)
|
|
|
|
|
{
|
|
|
|
|
UAnimGraphNode_Base* Node1 = Cast<UAnimGraphNode_Base>(GraphPinObj->GetOwningNode());
|
|
|
|
|
UAnimGraphNode_Base* Node2 = Cast<UAnimGraphNode_Base>(OtherPin->GetOwningNode());
|
|
|
|
|
if(Node1 && Node2)
|
|
|
|
|
{
|
|
|
|
|
if(UAnimBlueprint* AnimBlueprint = Cast<UAnimBlueprint>(FBlueprintEditorUtils::FindBlueprintForNode(Node1)))
|
|
|
|
|
{
|
|
|
|
|
if(AnimBlueprint->GetObjectBeingDebugged() != nullptr)
|
|
|
|
|
{
|
|
|
|
|
UAnimBlueprintGeneratedClass* AnimBlueprintClass = (UAnimBlueprintGeneratedClass*)(*(AnimBlueprint->GeneratedClass));
|
|
|
|
|
int32 SourceNodeId = AnimBlueprintClass->GetNodeIndexFromGuid(Node1->NodeGuid);
|
|
|
|
|
int32 TargetNodeId = AnimBlueprintClass->GetNodeIndexFromGuid(Node2->NodeGuid);
|
|
|
|
|
|
|
|
|
|
if(AttributeInfos.Num() > 0)
|
|
|
|
|
{
|
|
|
|
|
FTextBuilder TextBuilder;
|
|
|
|
|
TextBuilder.AppendLine(SGraphPin::GetTooltipText());
|
|
|
|
|
|
|
|
|
|
bool bAddedAttributeSubtitle = false;
|
|
|
|
|
|
|
|
|
|
for(const SGraphPinPose::FAttributeInfo& AttributeInfo : AttributeInfos)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(SourceNodeId != INDEX_NONE && TargetNodeId != INDEX_NONE)
|
|
|
|
|
{
|
|
|
|
|
const TArray<FAnimBlueprintDebugData::FAttributeRecord>* LinkAttributes;
|
|
|
|
|
|
|
|
|
|
if(GraphPinObj->Direction == EGPD_Input)
|
|
|
|
|
{
|
|
|
|
|
LinkAttributes = AnimBlueprintClass->GetAnimBlueprintDebugData().NodeInputAttributesThisFrame.Find(SourceNodeId);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LinkAttributes = AnimBlueprintClass->GetAnimBlueprintDebugData().NodeOutputAttributesThisFrame.Find(SourceNodeId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const bool bAttributeUsedInLink = LinkAttributes && LinkAttributes->ContainsByPredicate(
|
|
|
|
|
[&AttributeInfo, TargetNodeId](const FAnimBlueprintDebugData::FAttributeRecord& InRecord)
|
|
|
|
|
{
|
|
|
|
|
return InRecord.Attribute == AttributeInfo.Attribute && InRecord.OtherNode == TargetNodeId;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if(bAttributeUsedInLink)
|
|
|
|
|
{
|
|
|
|
|
if(!bAddedAttributeSubtitle)
|
|
|
|
|
{
|
|
|
|
|
TextBuilder.AppendLine(LOCTEXT("AttributesSubtitle", "Attributes:"));
|
|
|
|
|
bAddedAttributeSubtitle = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TextBuilder.AppendLine(AttributeInfo.Attribute);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return TextBuilder.ToText();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return SGraphPin::GetTooltipText();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|