Files
UnrealEngineUWP/Engine/Source/Developer/RigVMDeveloper/Private/RigVMModel/Nodes/RigVMFunctionReferenceNode.cpp
Helge Mathee 7be69d4077 Control Rig Encapsulation - Function Library Support - First pass
Added FunctionLibrary and FunctionReferenceNode classes
Implemented support and validation for those in the Controller
Implemented unit test for checking the validity of a FunctionReferenceNode.

#rb jack.cai
#jira UEA-564

[CL 15000860 by Helge Mathee in ue5-main branch]
2021-01-06 14:01:38 -04:00

63 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "RigVMModel/Nodes/RigVMFunctionReferenceNode.h"
#include "RigVMModel/RigVMFunctionLibrary.h"
FString URigVMFunctionReferenceNode::GetNodeTitle() const
{
if (URigVMLibraryNode* ReferencedNode = GetReferencedNode())
{
return ReferencedNode->GetNodeTitle();
}
return Super::GetNodeTitle();
}
FLinearColor URigVMFunctionReferenceNode::GetNodeColor() const
{
if (URigVMLibraryNode* ReferencedNode = GetReferencedNode())
{
return ReferencedNode->GetNodeColor();
}
return Super::GetNodeColor();
}
FText URigVMFunctionReferenceNode::GetToolTipText() const
{
if (URigVMLibraryNode* ReferencedNode = GetReferencedNode())
{
return ReferencedNode->GetToolTipText();
}
return Super::GetToolTipText();
}
URigVMFunctionLibrary* URigVMFunctionReferenceNode::GetLibrary() const
{
if(URigVMLibraryNode* ReferencedNode = GetReferencedNode())
{
return ReferencedNode->GetLibrary();
}
return nullptr;
}
URigVMGraph* URigVMFunctionReferenceNode::GetContainedGraph() const
{
if (URigVMLibraryNode* ReferencedNode = GetReferencedNode())
{
return ReferencedNode->GetContainedGraph();
}
return nullptr;
}
URigVMLibraryNode* URigVMFunctionReferenceNode::GetReferencedNode() const
{
if (!ReferencedNodePtr.IsValid())
{
ReferencedNodePtr.LoadSynchronous();
}
return ReferencedNodePtr.Get();
}
void URigVMFunctionReferenceNode::SetReferencedNode(URigVMLibraryNode* InReferenceNode)
{
ReferencedNodePtr = InReferenceNode;
}