Files
UnrealEngineUWP/Engine/Source/Editor/AnimGraph/Private/AnimGraphNode_TransitionPoseEvaluator.cpp
2014-09-03 18:14:09 -04:00

72 lines
2.7 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "AnimGraphPrivatePCH.h"
#include "AnimGraphNode_TransitionPoseEvaluator.h"
#include "AnimationCustomTransitionGraph.h"
#include "CompilerResultsLog.h"
#include "GraphEditorActions.h"
/////////////////////////////////////////////////////
// UAnimGraphNode_TransitionPoseEvaluator
#define LOCTEXT_NAMESPACE "UAnimGraphNode_TransitionPoseEvaluator"
UAnimGraphNode_TransitionPoseEvaluator::UAnimGraphNode_TransitionPoseEvaluator(const FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
}
FLinearColor UAnimGraphNode_TransitionPoseEvaluator::GetNodeTitleColor() const
{
return FColor(200, 100, 100);
}
FText UAnimGraphNode_TransitionPoseEvaluator::GetTooltipText() const
{
return (Node.DataSource == EEvaluatorDataSource::EDS_DestinationPose) ? LOCTEXT("GetDestinationStatePose_Tooltip", "Evaluates and returns the pose generated by the destination state of this transition") : LOCTEXT("GetSourceStatePose_Tooltip", "Evaluates and returns the pose generated by the setup prior to this transition firing");
}
FText UAnimGraphNode_TransitionPoseEvaluator::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
if (TitleType == ENodeTitleType::FullTitle)
{
return (Node.DataSource == EEvaluatorDataSource::EDS_DestinationPose) ? LOCTEXT("GetDestinationStatePose", "Get Destination State Pose") : LOCTEXT("GetSourceStatePose", "Get Source State Pose");
}
return LOCTEXT("InputPoseEvaluator", "Input Pose Evaluator");
}
void UAnimGraphNode_TransitionPoseEvaluator::ValidateAnimNodeDuringCompilation(class USkeleton* ForSkeleton, class FCompilerResultsLog& MessageLog)
{
if ((Node.EvaluatorMode != EEvaluatorMode::EM_Standard) && Node.FramesToCachePose < 1)
{
MessageLog.Error(TEXT("@@ is set to a mode that caches the pose, but frames to cache is less then 1."), this);
}
Super::ValidateAnimNodeDuringCompilation(ForSkeleton, MessageLog);
}
FString UAnimGraphNode_TransitionPoseEvaluator::GetNodeCategory() const
{
return TEXT("Transition");
}
bool UAnimGraphNode_TransitionPoseEvaluator::CanUserDeleteNode() const
{
// Allow deleting the node if we're in the wrong kind of graph (via some accident or regression)
return !(GetGraph()->IsA(UAnimationCustomTransitionGraph::StaticClass()));
}
void UAnimGraphNode_TransitionPoseEvaluator::GetMenuEntries(FGraphContextMenuBuilder& ContextMenuBuilder) const
{
// Intentionally empty: Don't allow an option to create them, as they're auto-created when custom blend graphs are made
}
void UAnimGraphNode_TransitionPoseEvaluator::GetMenuActions(FBlueprintActionDatabaseRegistrar& ActionRegistrar) const
{
// Intentionally empty: Don't allow an option to create them, as they're auto-created when custom blend graphs are made
}
#undef LOCTEXT_NAMESPACE