Files
UnrealEngineUWP/Engine/Source/Editor/AnimGraph/Public/AnimGraphNode_LinkedAnimLayer.h
Marc Audy 0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00

103 lines
3.9 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "Misc/Guid.h"
#include "AnimGraphNode_LinkedAnimGraphBase.h"
#include "Animation/AnimNode_LinkedAnimLayer.h"
#include "AnimGraphNode_LinkedAnimLayer.generated.h"
class FCompilerResultsLog;
class IDetailLayoutBuilder;
class IPropertyHandle;
class SToolTip;
UCLASS(MinimalAPI)
class UAnimGraphNode_LinkedAnimLayer : public UAnimGraphNode_LinkedAnimGraphBase
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, Category = Settings)
FAnimNode_LinkedAnimLayer Node;
/** Guid of the named layer graph we refer to */
UPROPERTY()
FGuid InterfaceGuid;
// Begin UObject interface
virtual void Serialize(FArchive& Ar) override;
//~ Begin UEdGraphNode Interface.
virtual FText GetTooltipText() const override;
virtual FSlateIcon GetIconAndTint(FLinearColor& OutColor) const override;
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
virtual void ValidateAnimNodeDuringCompilation(USkeleton* ForSkeleton, FCompilerResultsLog& MessageLog) override;
virtual UObject* GetJumpTargetForDoubleClick() const override;
virtual void JumpToDefinition() const override;
virtual bool HasExternalDependencies(TArray<class UStruct*>* OptionalOutput /*= NULL*/) const override;
virtual void ReconstructNode() override;
//~ End UEdGraphNode Interface.
// UK2Node interface
virtual void GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const override;
// UAnimGraphNode_Base interface
virtual void CustomizeDetails(IDetailLayoutBuilder& DetailBuilder) override;
// Optionally updates layer GUID if it is invalid
void UpdateGuidForLayer();
protected:
// ----- UI CALLBACKS ----- //
// Handlers for layer combo
void GetLayerNames(TArray<TSharedPtr<FString>>& OutStrings, TArray<TSharedPtr<SToolTip>>& OutToolTips, TArray<bool>& OutRestrictedItems);
FString GetLayerName() const;
void OnLayerChanged(IDetailLayoutBuilder* DetailBuilder);
bool HasAvailableLayers() const;
bool HasValidNonSelfLayer() const;
void HandleSetObjectBeingDebugged(UObject* InDebugObj);
void HandleInstanceChanged();
// ----- END UI CALLBACKS ----- //
// UAnimGraphNode_Base interface
virtual FProperty* GetPinProperty(FName InPinName) const override;
virtual void CreateCustomPins(TArray<UEdGraphPin*>* OldPins) override;
// Begin UAnimGraphNode_CustomProperty
virtual FAnimNode_CustomProperty* GetCustomPropertyNode() override { return &Node; }
virtual const FAnimNode_CustomProperty* GetCustomPropertyNode() const override { return &Node; }
virtual bool NeedsToSpecifyValidTargetClass() const override { return false; }
virtual UClass* GetTargetSkeletonClass() const override;
// Begin UAnimGraphNode_LinkedAnimGraphBase
virtual FAnimNode_LinkedAnimLayer* GetLinkedAnimGraphNode() override { return &Node; }
virtual const FAnimNode_LinkedAnimLayer* GetLinkedAnimGraphNode() const override { return &Node; }
virtual bool OnShouldFilterInstanceBlueprint(const FAssetData& AssetData) const override;
virtual FString GetCurrentInstanceBlueprintPath() const override;
virtual bool IsStructuralProperty(FProperty* InProperty) const override;
friend class FAnimationLayerDragDropAction;
// Helper function to get the interface currently in use by the selected layer
TSubclassOf<UInterface> GetInterfaceForLayer() const;
// Helper function to get the interface graph GUID currently in use by the selected layer
FGuid GetGuidForLayer() const;
// Get the preview node, if any, when instanced in an animation blueprint and debugged
FAnimNode_LinkedAnimLayer* GetPreviewNode() const;
// Helper function to setup a newly spawned node
void SetupFromLayerId(FName InLayerId);
// Handle used to hook into object being debugged changing
FDelegateHandle SetObjectBeingDebuggedHandle;
};
UE_DEPRECATED(4.24, "UAnimGraphNode_Layer has been renamed to UAnimGraphNode_LinkedAnimLayer")
typedef UAnimGraphNode_LinkedAnimLayer UAnimGraphNode_Layer;