2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
2014-06-26 03:00:24 -04:00
|
|
|
|
|
|
|
|
#include "Animation/AnimInstance.h"
|
2014-04-24 08:49:31 -04:00
|
|
|
#include "AnimStateNodeBase.h"
|
2014-11-12 04:58:53 -05:00
|
|
|
#include "Animation/AnimStateMachineTypes.h"
|
2014-06-26 03:00:24 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
#include "AnimStateTransitionNode.generated.h"
|
|
|
|
|
|
2014-06-26 03:00:24 -04:00
|
|
|
UCLASS(MinimalAPI, config=Editor)
|
2014-03-14 14:13:41 -04:00
|
|
|
class UAnimStateTransitionNode : public UAnimStateNodeBase
|
|
|
|
|
{
|
2015-03-17 05:38:32 -04:00
|
|
|
GENERATED_UCLASS_BODY()
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// The transition logic graph for this transition (returning a boolean)
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
class UEdGraph* BoundGraph;
|
|
|
|
|
|
2015-02-21 20:06:12 -05:00
|
|
|
// The animation graph for this transition if it uses custom blending (returning a pose)
|
2014-03-14 14:13:41 -04:00
|
|
|
UPROPERTY()
|
|
|
|
|
class UEdGraph* CustomTransitionGraph;
|
|
|
|
|
|
|
|
|
|
// The priority order of this transition. If multiple transitions out of a state go
|
|
|
|
|
// true at the same time, the one with the smallest priority order will take precedent
|
|
|
|
|
UPROPERTY(EditAnywhere, Category=Transition)
|
|
|
|
|
int32 PriorityOrder;
|
|
|
|
|
|
|
|
|
|
// The duration to cross-fade for
|
|
|
|
|
UPROPERTY(EditAnywhere, Config, Category=Transition)
|
|
|
|
|
float CrossfadeDuration;
|
|
|
|
|
|
|
|
|
|
// The type of blending to use in the crossfade
|
2015-07-01 09:45:27 -04:00
|
|
|
UPROPERTY()
|
|
|
|
|
TEnumAsByte<ETransitionBlendMode::Type> CrossfadeMode_DEPRECATED;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, Category=Transition)
|
|
|
|
|
EAlphaBlendOption BlendMode;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, Category=Transition)
|
|
|
|
|
UCurveFloat* CustomBlendCurve;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-09-02 10:20:31 -04:00
|
|
|
// The blend profile to use to evaluate this transition per-bone
|
|
|
|
|
UPROPERTY(EditAnywhere, Category=Transition)
|
|
|
|
|
UBlendProfile* BlendProfile;
|
|
|
|
|
|
2015-02-21 20:06:12 -05:00
|
|
|
// Try setting the rule automatically based on the player node remaining time and the CrossfadeDuration, ignoring the internal time
|
|
|
|
|
UPROPERTY(EditAnywhere, Category=Transition)
|
|
|
|
|
bool bAutomaticRuleBasedOnSequencePlayerInState;
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
// What transition logic to use
|
|
|
|
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Transition)
|
|
|
|
|
TEnumAsByte<ETransitionLogicType::Type> LogicType;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, Category=Events)
|
|
|
|
|
FAnimNotifyEvent TransitionStart;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, Category=Events)
|
|
|
|
|
FAnimNotifyEvent TransitionEnd;
|
|
|
|
|
|
|
|
|
|
UPROPERTY(EditAnywhere, Category=Events)
|
|
|
|
|
FAnimNotifyEvent TransitionInterrupt;
|
|
|
|
|
|
|
|
|
|
/** This transition can go both directions */
|
|
|
|
|
UPROPERTY(EditAnywhere, Category=Transition)
|
|
|
|
|
bool Bidirectional;
|
|
|
|
|
|
|
|
|
|
/** The rules for this transition may be shared with other transition nodes */
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
bool bSharedRules;
|
|
|
|
|
|
|
|
|
|
/** The cross-fade settings of this node may be shared */
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
bool bSharedCrossfade;
|
|
|
|
|
|
|
|
|
|
/** What we call this transition if we are shared ('Transition X to Y' can't be used since its used in multiple places) */
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
FString SharedRulesName;
|
|
|
|
|
|
|
|
|
|
/** Shared rules guid useful when copying between different state machines */
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
FGuid SharedRulesGuid;
|
|
|
|
|
|
|
|
|
|
/** Color we draw in the editor as if we are shared */
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
FLinearColor SharedColor;
|
|
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
FString SharedCrossfadeName;
|
|
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
FGuid SharedCrossfadeGuid;
|
|
|
|
|
|
|
|
|
|
UPROPERTY()
|
|
|
|
|
int32 SharedCrossfadeIdx;
|
|
|
|
|
|
2015-09-14 09:25:39 -04:00
|
|
|
//~ Begin UObject Interface
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
|
|
|
|
|
virtual void PostLoad() override;
|
2015-09-14 09:25:39 -04:00
|
|
|
//~ End UObject Interface
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-09-14 09:25:39 -04:00
|
|
|
//~ Begin UEdGraphNode Interface
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void AllocateDefaultPins() override;
|
|
|
|
|
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
|
2014-09-03 18:14:09 -04:00
|
|
|
virtual FText GetTooltipText() const override;
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual FLinearColor GetNodeTitleColor() const override;
|
|
|
|
|
virtual void PinConnectionListChanged(UEdGraphPin* Pin) override;
|
2015-04-01 07:20:55 -04:00
|
|
|
virtual bool CanDuplicateNode() const override { return true; }
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual void PrepareForCopying() override;
|
|
|
|
|
virtual void PostPasteNode() override;
|
|
|
|
|
virtual void PostPlacedNewNode() override;
|
|
|
|
|
virtual void DestroyNode() override;
|
|
|
|
|
virtual void ValidateNodeDuringCompilation(class FCompilerResultsLog& MessageLog) const override;
|
2015-09-14 09:25:39 -04:00
|
|
|
//~ End UEdGraphNode Interface
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2015-09-14 09:25:39 -04:00
|
|
|
//~ Begin UAnimStateNodeBase Interface
|
2014-06-13 06:14:46 -04:00
|
|
|
virtual UEdGraph* GetBoundGraph() const override { return BoundGraph; }
|
|
|
|
|
virtual UEdGraphPin* GetInputPin() const override { return Pins[0]; }
|
|
|
|
|
virtual UEdGraphPin* GetOutputPin() const override { return Pins[1]; }
|
2015-09-14 09:25:39 -04:00
|
|
|
//~ End UAnimStateNodeBase Interface
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
// @return the name of this state
|
2015-04-01 07:20:55 -04:00
|
|
|
ANIMGRAPH_API FString GetStateName() const override;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
ANIMGRAPH_API UAnimStateNodeBase* GetPreviousState() const;
|
|
|
|
|
ANIMGRAPH_API UAnimStateNodeBase* GetNextState() const;
|
|
|
|
|
ANIMGRAPH_API void CreateConnections(UAnimStateNodeBase* PreviousState, UAnimStateNodeBase* NextState);
|
|
|
|
|
|
|
|
|
|
ANIMGRAPH_API bool IsBoundGraphShared();
|
|
|
|
|
|
|
|
|
|
ANIMGRAPH_API void MakeRulesShareable(FString ShareName);
|
|
|
|
|
ANIMGRAPH_API void MakeCrossfadeShareable(FString ShareName);
|
|
|
|
|
|
|
|
|
|
ANIMGRAPH_API void UnshareRules();
|
|
|
|
|
ANIMGRAPH_API void UnshareCrossade();
|
|
|
|
|
|
|
|
|
|
ANIMGRAPH_API void UseSharedRules(const UAnimStateTransitionNode* Node);
|
|
|
|
|
ANIMGRAPH_API void UseSharedCrossfade(const UAnimStateTransitionNode* Node);
|
|
|
|
|
|
|
|
|
|
void CopyCrossfadeSettings(const UAnimStateTransitionNode* SrcNode);
|
|
|
|
|
void PropagateCrossfadeSettings();
|
|
|
|
|
|
|
|
|
|
ANIMGRAPH_API bool IsReverseTrans(const UAnimStateNodeBase* Node);
|
|
|
|
|
protected:
|
|
|
|
|
void CreateBoundGraph();
|
|
|
|
|
void CreateCustomTransitionGraph();
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
UEdGraph* GetCustomTransitionGraph() const { return CustomTransitionGraph; }
|
|
|
|
|
};
|