Files
UnrealEngineUWP/Engine/Source/Editor/AnimGraph/Private/AnimGraphNode_LinkedAnimGraph.cpp

222 lines
6.4 KiB
C++
Raw Permalink Normal View History

// Copyright Epic Games, Inc. All Rights Reserved.
#include "AnimGraphNode_LinkedAnimGraph.h"
#include "AnimGraphNode_AssetPlayerBase.h"
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox #ROBOMERGE-SOURCE: CL 16703644 in //UE5/Main/... #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529) [CL 16703653 by thomas sarkanen in ue5-release-engine-test branch]
2021-06-17 08:59:23 -04:00
#include "AnimGraphNode_CallFunction.h"
#include "BlueprintNodeSpawner.h"
#include "Animation/AnimBlueprint.h"
#include "AssetRegistry/AssetRegistryModule.h"
#include "Engine/Blueprint.h"
#include "BlueprintActionDatabaseRegistrar.h"
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox #ROBOMERGE-SOURCE: CL 16703644 in //UE5/Main/... #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529) [CL 16703653 by thomas sarkanen in ue5-release-engine-test branch]
2021-06-17 08:59:23 -04:00
#include "IAnimBlueprintCopyTermDefaultsContext.h"
#include "KismetCompiler.h"
#include "UObject/UE5MainStreamObjectVersion.h"
#define LOCTEXT_NAMESPACE "UAnimGraphNode_LinkedAnimGraph"
void UAnimGraphNode_LinkedAnimGraph::PostPasteNode()
{
Super::PostPasteNode();
// Clear incompatible target class
if(UClass* InstanceClass = GetTargetClass())
{
if(UAnimBlueprint* LinkedBlueprint = Cast<UAnimBlueprint>(UBlueprint::GetBlueprintFromClass(InstanceClass)))
{
if(UAnimBlueprint* ThisBlueprint = GetAnimBlueprint())
{
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox #ROBOMERGE-SOURCE: CL 16703644 in //UE5/Main/... #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529) [CL 16703653 by thomas sarkanen in ue5-release-engine-test branch]
2021-06-17 08:59:23 -04:00
if(!LinkedBlueprint->bIsTemplate && !ThisBlueprint->bIsTemplate && LinkedBlueprint->TargetSkeleton != ThisBlueprint->TargetSkeleton)
{
Node.InstanceClass = nullptr;
}
}
}
}
}
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox #ROBOMERGE-SOURCE: CL 16703644 in //UE5/Main/... #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529) [CL 16703653 by thomas sarkanen in ue5-release-engine-test branch]
2021-06-17 08:59:23 -04:00
TArray<UEdGraph*> UAnimGraphNode_LinkedAnimGraph::GetExternalGraphs() const
{
if(UClass* InstanceClass = GetTargetClass())
{
if(UAnimBlueprint* LinkedBlueprint = Cast<UAnimBlueprint>(UBlueprint::GetBlueprintFromClass(InstanceClass)))
{
for(UEdGraph* Graph : LinkedBlueprint->FunctionGraphs)
{
if(Graph->GetFName() == UEdGraphSchema_K2::GN_AnimGraph)
{
return { Graph };
}
}
}
}
return TArray<UEdGraph*>();
}
void UAnimGraphNode_LinkedAnimGraph::SetupFromAsset(const FAssetData& InAssetData, bool bInIsTemplateNode)
{
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox #ROBOMERGE-SOURCE: CL 16703644 in //UE5/Main/... #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529) [CL 16703653 by thomas sarkanen in ue5-release-engine-test branch]
2021-06-17 08:59:23 -04:00
if(InAssetData.IsValid())
{
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox #ROBOMERGE-SOURCE: CL 16703644 in //UE5/Main/... #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529) [CL 16703653 by thomas sarkanen in ue5-release-engine-test branch]
2021-06-17 08:59:23 -04:00
InAssetData.GetTagValue("TargetSkeleton", SkeletonName);
if(SkeletonName == TEXT("None"))
{
SkeletonName.Empty();
}
FString TagTemplateValue;
InAssetData.GetTagValue("bIsTemplate", TagTemplateValue);
bIsTemplateAnimBlueprint = TagTemplateValue.Equals(TEXT("True"));
FString BlueprintTypeValue;
InAssetData.GetTagValue("BlueprintType", BlueprintTypeValue);
bIsInterfaceBlueprint = BlueprintTypeValue.Equals(TEXT("BPTYPE_Interface"));
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox #ROBOMERGE-SOURCE: CL 16703644 in //UE5/Main/... #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529) [CL 16703653 by thomas sarkanen in ue5-release-engine-test branch]
2021-06-17 08:59:23 -04:00
if(!bInIsTemplateNode)
{
UAnimBlueprint* AnimBlueprint = CastChecked<UAnimBlueprint>(InAssetData.GetAsset());
Node.InstanceClass = AnimBlueprint->GeneratedClass.Get();
}
}
// Set up function reference
FunctionReference.SetExternalMember(UEdGraphSchema_K2::GN_AnimGraph, GetTargetClass());
}
void UAnimGraphNode_LinkedAnimGraph::GetMenuActions(FBlueprintActionDatabaseRegistrar& InActionRegistrar) const
{
UAnimGraphNode_AssetPlayerBase::GetMenuActionsHelper(
InActionRegistrar,
GetClass(),
{ UAnimBlueprint::StaticClass()},
{ },
[](const FAssetData& InAssetData, UClass* InClass)
{
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox #ROBOMERGE-SOURCE: CL 16703644 in //UE5/Main/... #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529) [CL 16703653 by thomas sarkanen in ue5-release-engine-test branch]
2021-06-17 08:59:23 -04:00
if(InAssetData.IsValid())
{
FText DisplayName;
InAssetData.GetTagValue(FBlueprintTags::BlueprintDisplayName, DisplayName);
if(!DisplayName.IsEmpty())
{
return DisplayName;
}
else
{
return FText::Format(LOCTEXT("MenuDescFormat", "{0} - Linked Anim Graph"), FText::FromName(InAssetData.AssetName));
}
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox #ROBOMERGE-SOURCE: CL 16703644 in //UE5/Main/... #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529) [CL 16703653 by thomas sarkanen in ue5-release-engine-test branch]
2021-06-17 08:59:23 -04:00
}
return LOCTEXT("MenuDesc", "Linked Anim Graph");
},
[](const FAssetData& InAssetData, UClass* InClass)
{
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox #ROBOMERGE-SOURCE: CL 16703644 in //UE5/Main/... #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529) [CL 16703653 by thomas sarkanen in ue5-release-engine-test branch]
2021-06-17 08:59:23 -04:00
if(InAssetData.IsValid())
{
FText Description;
InAssetData.GetTagValue(FBlueprintTags::BlueprintDescription, Description);
if(!Description.IsEmpty())
{
return Description;
}
else
{
return FText::Format(LOCTEXT("MenuDescTooltipFormat", "Linked Anim Graph - Runs a linked anim graph in another instance to process animation\n'{0}'"), FText::FromString(InAssetData.GetObjectPathString()));
}
Anim blueprint encapsulation improvements Adds 'template' anim BP concept. These anim BPs have no TargetSkeleton and as such cannot have direct references to animations placed inside of their anim graphs Adds function call support from anim nodes. All anim graph nodes can now call functions when initialized, updated, evaluated or when they first become relevant. Relevancy is established using a new FAnimSubsystemInstance_NodeRelevancy which tracks nodes in a local map, per UAnimInstance, if nodes require it. Functions are displayed on the node if bound, and in the details panel. Added a new override point to FAnimSubsystemInstance to allow for WT init. Moved FMemberReference customization into a public header so it can be used on anim node functions. Wrapped functions up into FAnimNodeFunctionRef structure so they can be re-used more effectively. Converted CallFunction node to use them. Added a couple of simple BP function libraries to demonstrate the use of the new FAnimNodeContext (this is intended to be a generic way of exposing FAnimNode_Base types to script without the node types themselves having to be known to script directly). Added the ability to set exposed properties as 'always dynamic' so they appear in mutable data rather than being merged into constants. This allows for the anim node data API to be changed to be less strict (and more script friendly). Now values can be set in mutable data (via GET_MUTABLE_ANIM_NODE_DATA_PTR) and attempted sets to constant data can be ignored and reported to client code. A few minor crash fixes with edge cases (inc when trying to open an asset editor fails because of a missing skeleton/cancellation). Also fixes an issue where literal linked anim graph/control rig/custom poroperty node inputs didnt get copied #rb Jurre.deBaare,Aaron.Cox #ROBOMERGE-SOURCE: CL 16703644 in //UE5/Main/... #ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529) [CL 16703653 by thomas sarkanen in ue5-release-engine-test branch]
2021-06-17 08:59:23 -04:00
}
else
{
return LOCTEXT("MenuDescTooltip", "Linked Anim Graph");
}
},
[](UEdGraphNode* InNewNode, bool bInIsTemplateNode, const FAssetData InAssetData)
{
UAnimGraphNode_LinkedAnimGraph* GraphNode = CastChecked<UAnimGraphNode_LinkedAnimGraph>(InNewNode);
GraphNode->SetupFromAsset(InAssetData, bInIsTemplateNode);
},
nullptr,
[](const FAssetData& InAssetData)
{
if(InAssetData.IsValid())
{
FText Category;
InAssetData.GetTagValue(FBlueprintTags::BlueprintCategory, Category);
return Category;
}
else
{
return FText::GetEmpty();
}
});
}
bool UAnimGraphNode_LinkedAnimGraph::IsActionFilteredOut(class FBlueprintActionFilter const& Filter)
{
bool bIsFilteredOut = false;
if(bIsInterfaceBlueprint)
{
bIsFilteredOut = true;
}
else if(!SkeletonName.IsEmpty())
{
FBlueprintActionContext const& FilterContext = Filter.Context;
for (UBlueprint* Blueprint : FilterContext.Blueprints)
{
if (UAnimBlueprint* AnimBlueprint = Cast<UAnimBlueprint>(Blueprint))
{
if(!AnimBlueprint->IsCompatibleByAssetString(SkeletonName, bIsTemplateAnimBlueprint, bIsInterfaceBlueprint))
{
bIsFilteredOut = true;
break;
}
}
else
{
// Not an animation Blueprint, cannot use
bIsFilteredOut = true;
break;
}
}
}
return bIsFilteredOut;
}
void UAnimGraphNode_LinkedAnimGraph::Serialize(FArchive& Ar)
{
Super::Serialize(Ar);
Ar.UsingCustomVersion(FUE5MainStreamObjectVersion::GUID);
if(Ar.IsLoading() && Ar.CustomVer(FUE5MainStreamObjectVersion::GUID) < FUE5MainStreamObjectVersion::AnimGraphNodeTaggingAdded)
{
// Transfer old tag to new system
SetTagInternal(Node.Tag_DEPRECATED);
}
}
FAnimNode_CustomProperty* UAnimGraphNode_LinkedAnimGraph::GetCustomPropertyNode()
{
FAnimNode_CustomProperty* const RuntimeCustomPropertyNode = GetDebuggedAnimNode<FAnimNode_CustomProperty>();
return RuntimeCustomPropertyNode ? RuntimeCustomPropertyNode : &Node;
}
const FAnimNode_CustomProperty* UAnimGraphNode_LinkedAnimGraph::GetCustomPropertyNode() const
{
const FAnimNode_CustomProperty* const RuntimeCustomPropertyNode = GetDebuggedAnimNode<FAnimNode_CustomProperty>();
return RuntimeCustomPropertyNode ? RuntimeCustomPropertyNode : &Node;
}
FAnimNode_LinkedAnimGraph* UAnimGraphNode_LinkedAnimGraph::GetLinkedAnimGraphNode()
{
FAnimNode_LinkedAnimGraph* const RuntimeLinkedAnimGraphNode = GetDebuggedAnimNode<FAnimNode_LinkedAnimGraph>();
return RuntimeLinkedAnimGraphNode ? RuntimeLinkedAnimGraphNode : &Node;
}
const FAnimNode_LinkedAnimGraph* UAnimGraphNode_LinkedAnimGraph::GetLinkedAnimGraphNode() const
{
const FAnimNode_LinkedAnimGraph* const RuntimeLinkedAnimGraphNode = GetDebuggedAnimNode<FAnimNode_LinkedAnimGraph>();
return RuntimeLinkedAnimGraphNode ? RuntimeLinkedAnimGraphNode : &Node;
}
#undef LOCTEXT_NAMESPACE