Thanks for the suggestion. The team probably won’t be able to add this, but this is definitely something that you could add very easily. Subclassing FAnimNode_BlendListBase and making an FAnimNode_BlendListByGameplayTag should be very straightforward, and it wouldn’t touch engine code modification.
Let me know if you would like something cursory to try. The unfortunate bit would be that it would need to be something you maintain or expand upon.
I did start to reverse engineer the BlendByEnum as it also named the pins on the graph node. I don’t have everything completed yet, and also don’t pretend to know how everything works, it appears to be working in PIE. I did throw everything, including the kitchen sink, in here to solve some problems so I need to check out my includes and such. [Image Removed]
#pragma once
// Epic Includes
#include "AnimNodes/AnimNode_BlendListBase.h"
#include "GameplayTagContainer.h"
// My Includes
#include "AnimNode_BlendByGameplayTag.generated.h"
//=============================================================================
// FAnimNode_BlendByGameplayTag
//=============================================================================
// This is the runtime portion for an animation graph node that will hide
// multiple bones by scaling them to FVector::ZeroVector. The bones are listed in an array within a struct.
//=============================================================================
USTRUCT(BlueprintInternalUseOnly)
struct My_API FAnimNode_BlendByGameplayTag : public FAnimNode_BlendListBase
{
GENERATED_BODY()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// @BeginSection FAnimNode_Base
// @EndSection FAnimNode_Base
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// @BeginSection FAnimNode_BlendByGameplayTag
private:
// Mapping from enum value to BlendPose index; there will be one entry per entry in the enum; entries out of range always map to pose index 0
UPROPERTY(meta=(FoldProperty))
TArray<FGameplayTag> GameplayTagToPoseArray;
public:
UPROPERTY(EditAnywhere, Category=Runtime, meta=(PinShownByDefault, FoldProperty))
FGameplayTag ActiveGameplayTag;
UPROPERTY(EditAnywhere, Category=Runtime, meta=(FoldProperty, NeverAsPin))
FGameplayTagContainer AnimNode_GameplayTagContainer;
FAnimNode_BlendByGameplayTag() = default;
FGameplayTagContainer GetGameplayTagContainer() { return AnimNode_GameplayTagContainer; }
// Get the mapping from gameplay tag value to BlendPose index;
// there will be one entry per entry in the gameplay tag list;
// entries out of range always map to pose index 0
const TArray<FGameplayTag>& GetGameplayTagToPoseIndex() const;
void SetGameplayTagToPoseArray(const TArray<FGameplayTag>& InArray) { GameplayTagToPoseArray = InArray; }
// Get the currently selected pose (as a gameplay tag value)
FGameplayTag GetActiveGameplayTagValue() const;
protected:
virtual int32 GetActiveChildIndex() override;
virtual FString GetNodeName(FNodeDebugData& DebugData) override { return DebugData.GetNodeName(this); }
// @EndSection FAnimNode_BlendByGameplayTag
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
};
Nice, that looks pretty good. Feel free to make a PR, and I can get it in front of the right people to see if they want to take it. Better to have the option than not. If we did accept it, though, it probably wouldn’t make it into 5.8