Files
UnrealEngineUWP/Engine/Source/Editor/AnimGraph/Private/AnimGraphNode_ApplyMeshSpaceAdditive.cpp
Marc Audy d90da4ab1a Merge to Dev-Main for 4.20 @ 4090813
#rb
#rnx
#lockdown Nick.Penwarden

[CL 4091081 by Marc Audy in Main branch]
2018-05-23 21:04:31 -04:00

78 lines
2.4 KiB
C++

// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
#include "AnimGraphNode_ApplyMeshSpaceAdditive.h"
#include "Animation/AnimationSettings.h"
#include "Kismet2/CompilerResultsLog.h"
/////////////////////////////////////////////////////
// UAnimGraphNode_ApplyAdditive
#define LOCTEXT_NAMESPACE "A3Nodes"
UAnimGraphNode_ApplyMeshSpaceAdditive::UAnimGraphNode_ApplyMeshSpaceAdditive(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
FLinearColor UAnimGraphNode_ApplyMeshSpaceAdditive::GetNodeTitleColor() const
{
return FLinearColor(0.75f, 0.75f, 0.75f);
}
FText UAnimGraphNode_ApplyMeshSpaceAdditive::GetTooltipText() const
{
return LOCTEXT("AnimGraphNode_ApplyMeshSpaceAdditive_Tooltip", "Apply mesh space additive animation to normal pose");
}
FText UAnimGraphNode_ApplyMeshSpaceAdditive::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
return LOCTEXT("AnimGraphNode_ApplyMeshSpaceAdditive_Title", "Apply Mesh Space Additive");
}
void UAnimGraphNode_ApplyMeshSpaceAdditive::CustomizePinData(UEdGraphPin* Pin, FName SourcePropertyName, int32 ArrayIndex) const
{
Super::CustomizePinData(Pin, SourcePropertyName, ArrayIndex);
if (Pin->PinName == GET_MEMBER_NAME_STRING_CHECKED(FAnimNode_ApplyMeshSpaceAdditive, Alpha))
{
if (!Pin->bHidden)
{
Pin->PinFriendlyName = Node.AlphaScaleBias.GetFriendlyName(Pin->PinFriendlyName);
}
}
}
void UAnimGraphNode_ApplyMeshSpaceAdditive::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent)
{
const FName PropertyName = (PropertyChangedEvent.Property ? PropertyChangedEvent.Property->GetFName() : NAME_None);
// Reconstruct node to show updates to PinFriendlyNames.
if ((PropertyName == GET_MEMBER_NAME_STRING_CHECKED(FAnimNode_ApplyMeshSpaceAdditive, AlphaScaleBias)))
{
ReconstructNode();
}
Super::PostEditChangeProperty(PropertyChangedEvent);
}
FString UAnimGraphNode_ApplyMeshSpaceAdditive::GetNodeCategory() const
{
return TEXT("Blends");
//@TODO: TEXT("Apply additive to normal pose"), TEXT("Apply additive pose"));
}
void UAnimGraphNode_ApplyMeshSpaceAdditive::ValidateAnimNodeDuringCompilation(class USkeleton* ForSkeleton, class FCompilerResultsLog& MessageLog)
{
Super::ValidateAnimNodeDuringCompilation(ForSkeleton, MessageLog);
if (UAnimationSettings::Get()->bEnablePerformanceLog)
{
if (Node.LODThreshold < 0)
{
MessageLog.Warning(TEXT("@@ contains no LOD Threshold."), this);
}
}
}
#undef LOCTEXT_NAMESPACE