You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
[UE-168360] User can create a transition from a state into the entry state * Relinking multiple transitions (transition nodes at once) when none of the transition nodes is selected. * Selective relinking in case a subset of the transition nodes on a transitions are selected. * Special case handling for transitions from entry state (they don't have a transition node connected). * Drawing circle indicator around the arrow head in case the mouse cursor is approaching the transition. * Hovering the arrow head of a transition highlights it by filling the circle with solid orange color and turning the arrow black. * Ending the relink operation in empty space or the entry node will cancel the relink operation. * Fixed bug that prevents creating new transitions ending in an entry state. #jira https://jira.it.epicgames.com/browse/UE-136096 #jira https://jira.it.epicgames.com/browse/UE-168360 #preflight 636a169963037c10262bc421 [CL 23025287 by benjamin jillich in ue5-main branch]
97 lines
4.6 KiB
C++
97 lines
4.6 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "UObject/ObjectMacros.h"
|
|
#include "AssetRegistry/AssetData.h"
|
|
#include "EdGraph/EdGraphSchema.h"
|
|
#include "AnimationStateMachineSchema.generated.h"
|
|
|
|
class FMenuBuilder;
|
|
class UEdGraph;
|
|
|
|
/** Action to add a node to the graph */
|
|
USTRUCT()
|
|
struct ANIMGRAPH_API FEdGraphSchemaAction_NewStateNode : public FEdGraphSchemaAction
|
|
{
|
|
GENERATED_USTRUCT_BODY()
|
|
|
|
UEdGraphNode* NodeTemplate;
|
|
|
|
FEdGraphSchemaAction_NewStateNode()
|
|
: FEdGraphSchemaAction()
|
|
, NodeTemplate(nullptr)
|
|
{}
|
|
|
|
FEdGraphSchemaAction_NewStateNode(FText InNodeCategory, FText InMenuDesc, FText InToolTip, const int32 InGrouping)
|
|
: FEdGraphSchemaAction(MoveTemp(InNodeCategory), MoveTemp(InMenuDesc), MoveTemp(InToolTip), InGrouping)
|
|
, NodeTemplate(nullptr)
|
|
{}
|
|
|
|
virtual UEdGraphNode* PerformAction(class UEdGraph* ParentGraph, UEdGraphPin* FromPin, const FVector2D Location, bool bSelectNewNode = true) override;
|
|
virtual void AddReferencedObjects( FReferenceCollector& Collector ) override;
|
|
|
|
template <typename NodeType>
|
|
static NodeType* SpawnNodeFromTemplate(class UEdGraph* ParentGraph, NodeType* InTemplateNode, const FVector2D Location = FVector2D(0.0f, 0.0f), bool bSelectNewNode = true)
|
|
{
|
|
FEdGraphSchemaAction_NewStateNode Action;
|
|
Action.NodeTemplate = InTemplateNode;
|
|
|
|
return Cast<NodeType>(Action.PerformAction(ParentGraph, NULL, Location, bSelectNewNode));
|
|
}
|
|
};
|
|
|
|
/** Action to create new comment */
|
|
USTRUCT()
|
|
struct ANIMGRAPH_API FEdGraphSchemaAction_NewStateComment : public FEdGraphSchemaAction
|
|
{
|
|
GENERATED_USTRUCT_BODY();
|
|
|
|
FEdGraphSchemaAction_NewStateComment()
|
|
: FEdGraphSchemaAction()
|
|
{}
|
|
|
|
FEdGraphSchemaAction_NewStateComment(FText InNodeCategory, FText InMenuDesc, FText InToolTip, const int32 InGrouping)
|
|
: FEdGraphSchemaAction(MoveTemp(InNodeCategory), MoveTemp(InMenuDesc), MoveTemp(InToolTip), InGrouping)
|
|
{}
|
|
|
|
//~ Begin FEdGraphSchemaAction Interface
|
|
virtual UEdGraphNode* PerformAction(class UEdGraph* ParentGraph, UEdGraphPin* FromPin, const FVector2D Location, bool bSelectNewNode = true) override;
|
|
//~ End FEdGraphSchemaAction Interface
|
|
};
|
|
|
|
|
|
UCLASS(MinimalAPI)
|
|
class UAnimationStateMachineSchema : public UEdGraphSchema
|
|
{
|
|
GENERATED_UCLASS_BODY()
|
|
|
|
ANIMGRAPH_API static const FName PC_Exec;
|
|
|
|
//~ Begin UEdGraphSchema Interface
|
|
virtual void CreateDefaultNodesForGraph(UEdGraph& Graph) const override;
|
|
virtual const FPinConnectionResponse CanCreateConnection(const UEdGraphPin* A, const UEdGraphPin* B) const override;
|
|
virtual bool TryCreateConnection(UEdGraphPin* A, UEdGraphPin* B) const override;
|
|
virtual bool CreateAutomaticConversionNodeAndConnections(UEdGraphPin* PinA, UEdGraphPin* PinB) const override;
|
|
virtual bool TryRelinkConnectionTarget(UEdGraphPin* SourcePin, UEdGraphPin* OldTargetPin, UEdGraphPin* NewTargetPin, const TArray<UEdGraphNode*>& InSelectedGraphNodes) const override;
|
|
virtual bool IsConnectionRelinkingAllowed(UEdGraphPin* InPin) const override;
|
|
virtual const FPinConnectionResponse CanRelinkConnectionToPin(const UEdGraphPin* OldSourcePin, const UEdGraphPin* TargetPinCandidate) const override;
|
|
virtual void GetGraphContextActions(FGraphContextMenuBuilder& ContextMenuBuilder) const override;
|
|
virtual EGraphType GetGraphType(const UEdGraph* TestEdGraph) const override;
|
|
virtual void GetContextMenuActions(class UToolMenu* Menu, class UGraphNodeContextMenuContext* Context) const override;
|
|
virtual FLinearColor GetPinTypeColor(const FEdGraphPinType& PinType) const override;
|
|
virtual void GetGraphDisplayInformation(const UEdGraph& Graph, /*out*/ FGraphDisplayInfo& DisplayInfo) const override;
|
|
virtual void DroppedAssetsOnGraph(const TArray<FAssetData>& Assets, const FVector2D& GraphPosition, UEdGraph* Graph) const override;
|
|
virtual void DroppedAssetsOnNode(const TArray<FAssetData>& Assets, const FVector2D& GraphPosition, UEdGraphNode* Node) const override;
|
|
virtual void DroppedAssetsOnPin(const TArray<FAssetData>& Assets, const FVector2D& GraphPosition, UEdGraphPin* Pin) const override;
|
|
virtual void GetAssetsNodeHoverMessage(const TArray<FAssetData>& Assets, const UEdGraphNode* HoverNode, FString& OutTooltipText, bool& OutOkIcon) const override;
|
|
virtual void GetAssetsPinHoverMessage(const TArray<FAssetData>& Assets, const UEdGraphPin* HoverPin, FString& OutTooltipText, bool& OutOkIcon) const override;
|
|
|
|
virtual void BreakNodeLinks(UEdGraphNode& TargetNode) const override;
|
|
virtual void BreakPinLinks(UEdGraphPin& TargetPin, bool bSendsNodeNotification) const override;
|
|
virtual void BreakSinglePinLink(UEdGraphPin* SourcePin, UEdGraphPin* TargetPin) const override;
|
|
//~ End UEdGraphSchema Interface
|
|
};
|