You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb sara.schvartzman #jira UE-139731 #preflight https://horde.devtools.epicgames.com/job/61ea9f26445cebac10bf1f63 #ROBOMERGE-AUTHOR: helge.mathee #ROBOMERGE-SOURCE: CL 18688153 in //UE5/Release-5.0/... via CL 18688156 via CL 18688161 #ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472) [CL 18688164 by helge mathee in ue5-main branch]
92 lines
1.7 KiB
C++
92 lines
1.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "RigVMModel/RigVMLink.h"
|
|
#include "RigVMModel/RigVMGraph.h"
|
|
|
|
URigVMGraph* URigVMLink::GetGraph() const
|
|
{
|
|
return Cast<URigVMGraph>(GetOuter());
|
|
}
|
|
|
|
void URigVMLink::Serialize(FArchive& Ar)
|
|
{
|
|
if (Ar.IsLoading())
|
|
{
|
|
Ar << SourcePinPath;
|
|
Ar << TargetPinPath;
|
|
}
|
|
else
|
|
{
|
|
FString SourcePinPathTemp;
|
|
if (SourcePin)
|
|
{
|
|
if (SourcePin->GetNode())
|
|
{
|
|
SourcePinPathTemp = SourcePin->GetPinPath();
|
|
}
|
|
}
|
|
FString TargetPinPathTemp;
|
|
if (TargetPin)
|
|
{
|
|
if (TargetPin->GetNode())
|
|
{
|
|
TargetPinPathTemp = TargetPin->GetPinPath();
|
|
}
|
|
}
|
|
Ar << SourcePinPathTemp;
|
|
Ar << TargetPinPathTemp;
|
|
}
|
|
}
|
|
|
|
int32 URigVMLink::GetLinkIndex() const
|
|
{
|
|
int32 Index = INDEX_NONE;
|
|
URigVMGraph* Graph = GetGraph();
|
|
if (Graph != nullptr)
|
|
{
|
|
Graph->GetLinks().Find((URigVMLink*)this, Index);
|
|
}
|
|
return Index;
|
|
|
|
}
|
|
|
|
URigVMPin* URigVMLink::GetSourcePin()
|
|
{
|
|
if (SourcePin == nullptr)
|
|
{
|
|
SourcePin = GetGraph()->FindPin(SourcePinPath);
|
|
}
|
|
return SourcePin;
|
|
}
|
|
|
|
URigVMPin* URigVMLink::GetTargetPin()
|
|
{
|
|
if (TargetPin == nullptr)
|
|
{
|
|
TargetPin = GetGraph()->FindPin(TargetPinPath);
|
|
}
|
|
return TargetPin;
|
|
}
|
|
|
|
FString URigVMLink::GetPinPathRepresentation()
|
|
{
|
|
return FString::Printf(TEXT("%s -> %s"), *GetSourcePin()->GetPinPath(), *GetTargetPin()->GetPinPath());
|
|
}
|
|
|
|
bool URigVMLink::SplitPinPathRepresentation(const FString& InString, FString& OutSource, FString& OutTarget)
|
|
{
|
|
return InString.Split(TEXT(" -> "), &OutSource, &OutTarget);
|
|
}
|
|
|
|
void URigVMLink::PrepareForCopy()
|
|
{
|
|
if (URigVMPin* CurrentSourcePin = GetSourcePin())
|
|
{
|
|
SourcePinPath = CurrentSourcePin->GetPinPath();
|
|
}
|
|
if (URigVMPin* CurrenTargetPin = GetTargetPin())
|
|
{
|
|
TargetPinPath = CurrenTargetPin->GetPinPath();
|
|
}
|
|
}
|