Is it possible to get an AnimMontage's "Meta Data" in Blueprints?

The AnimMontage has a “Meta Data” that I can associate with it to add more information to that montage. The documentation on: Animation Montage | Unreal Engine Documentation – explains how to later query that Meta Data on c++.

But what about Blueprints? I was able to create a Meta Data class, associate it to my AnimMontage. But now how can I get this Meta Data from an anim graph? I can get a reference to my Montage in the graph, but there’s nothing about Meta Data in it.

1 Like

If you are searching for MetaData in AnimMontage is probably because you want to pass data to the AnimMontage from your code. The way to do it is not to use MetaData, but to create a subclass of UAnimNotify, which holds the parameter and then pass this parameter to it from your code.

Yes, create a blueprint function library in C++ and add this function to the header:


	/** Retrieves all Meta Data Instances from the given Animation Sequence */
	UFUNCTION(BlueprintPure, Category = "Animation")
	static void GetMetaData(const UAnimSequenceBase* AnimationSequence, TArray<UAnimMetaData*>& MetaData);

cpp:

#include "Animation/AnimSequenceBase.h"
#include "Animation/AnimMetaData.h"

(...)

void UMyBlueprintFunctionLibrary::GetMetaData(const UAnimSequenceBase* AnimationSequence, TArray<UAnimMetaData*>& MetaData)
{
	MetaData.Empty();
	if (AnimationSequence)
	{
		MetaData = AnimationSequence->GetMetaData();
	}
}

Use a cast node to cast the AnimMetaData object to your specific MetaData class.

1 Like