2019-12-26 15:33:43 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
2019-05-22 12:00:20 -04:00
# pragma once
# include "CoreMinimal.h"
# include "UObject/ObjectMacros.h"
# include "Misc/Guid.h"
# include "AnimGraphNode_CustomProperty.h"
2019-09-23 07:23:26 -04:00
# include "AnimGraphNode_LinkedAnimGraphBase.generated.h"
2019-05-22 12:00:20 -04:00
class FCompilerResultsLog ;
class IDetailLayoutBuilder ;
class IPropertyHandle ;
class SToolTip ;
2019-09-23 07:23:26 -04:00
struct FAnimNode_LinkedAnimGraph ;
2019-05-22 12:00:20 -04:00
UCLASS ( MinimalAPI , Abstract )
2019-09-23 07:23:26 -04:00
class UAnimGraphNode_LinkedAnimGraphBase : public UAnimGraphNode_CustomProperty
2019-05-22 12:00:20 -04:00
{
GENERATED_BODY ( )
public :
//~ Begin UEdGraphNode Interface.
virtual FLinearColor GetNodeTitleColor ( ) const override ;
virtual FText GetTooltipText ( ) const override ;
virtual FText GetNodeTitle ( ENodeTitleType : : Type TitleType ) const override ;
virtual void ValidateAnimNodeDuringCompilation ( USkeleton * ForSkeleton , FCompilerResultsLog & MessageLog ) override ;
virtual void ReallocatePinsDuringReconstruction ( TArray < UEdGraphPin * > & OldPins ) override ;
virtual void PostEditChangeProperty ( FPropertyChangedEvent & PropertyChangedEvent ) override ;
virtual void CustomizeDetails ( IDetailLayoutBuilder & DetailBuilder ) override ;
//~ End UEdGraphNode Interface.
// UAnimGraphNode_Base interface
virtual FPoseLinkMappingRecord GetLinkIDLocation ( const UScriptStruct * NodeType , UEdGraphPin * SourcePin ) override ;
// UAnimGraphNode_CustomProperty interface
2019-12-13 11:07:03 -05:00
virtual bool IsStructuralProperty ( FProperty * InProperty ) const override ;
2019-05-22 12:00:20 -04:00
// Node accessor
2019-09-23 07:23:26 -04:00
virtual FAnimNode_LinkedAnimGraph * GetLinkedAnimGraphNode ( ) PURE_VIRTUAL ( UAnimGraphNode_LinkedAnimGraphBase : : GetLinkedAnimGraphNode , return nullptr ; ) ;
virtual const FAnimNode_LinkedAnimGraph * GetLinkedAnimGraphNode ( ) const PURE_VIRTUAL ( UAnimGraphNode_LinkedAnimGraphBase : : GetLinkedAnimGraphNode , return nullptr ; ) ;
2019-05-22 12:00:20 -04:00
protected :
2019-09-23 07:23:26 -04:00
// Finds out whether there is a loop in the graph formed by linked instances from this node
2019-05-22 12:00:20 -04:00
bool HasInstanceLoop ( ) ;
2019-08-08 11:18:26 -04:00
2019-09-23 07:23:26 -04:00
/** Generates widgets for exposing/hiding Pins for this node using the provided detail builder */
2019-08-08 11:18:26 -04:00
void GenerateExposedPinsDetails ( IDetailLayoutBuilder & DetailBuilder ) ;
2019-05-22 12:00:20 -04:00
2019-09-23 07:23:26 -04:00
// Finds out whether there is a loop in the graph formed by linked instances from CurrNode, used by HasInstanceLoop. VisitedNodes and NodeStack are required
2019-05-22 12:00:20 -04:00
// to track the graph links
// VisitedNodes - Node we have searched the links of, so we don't do it twice
// NodeStack - The currently considered chain of nodes. If a loop is detected this will contain the chain that causes the loop
2019-09-23 07:23:26 -04:00
static bool HasInstanceLoop_Recursive ( UAnimGraphNode_LinkedAnimGraphBase * CurrNode , TArray < FGuid > & VisitedNodes , TArray < FGuid > & NodeStack ) ;
2019-05-22 12:00:20 -04:00
// ----- UI CALLBACKS ----- //
// Gets path to the currently selected instance class' blueprint
virtual FString GetCurrentInstanceBlueprintPath ( ) const ;
// Filter callback for blueprints (only accept matching skeletons/interfaces)
virtual bool OnShouldFilterInstanceBlueprint ( const FAssetData & AssetData ) const ;
// Instance blueprint was changed by user
void OnSetInstanceBlueprint ( const FAssetData & AssetData , IDetailLayoutBuilder * InDetailBuilder ) ;
// ----- END UI CALLBACKS ----- //
} ;
2019-09-23 07:23:26 -04:00
UE_DEPRECATED ( 4.24 , " UAnimGraphNode_SubInstanceBase has been renamed to UAnimGraphNode_LinkedAnimGraphBase " )
typedef UAnimGraphNode_LinkedAnimGraphBase UAnimGraphNode_SubInstanceBase ;