Storing Animation references not possible. No data types in Blueprint available for 'Animation Asset Reference' or 'Single Animation Play Data Structure'

Hey everyone,

I’m trying to store animation references from a skeletal mesh inside an array to retrieve them later. I found that certain values cannot be promoted to a variable inside Blueprints, for example ‘Animation Asset Reference’ or ‘Single Animation Play Data Structure’. Also I cannot find the data type when trying to add a new variable to the blueprint. In the attached images you can see my blueprint sequence and which data types I mean. The Blueprint belongs to my Player Character class, so ‘self’ refers to a Character.

I’m rather new to Unreal Engine 4, so maybe there is a valid reason behind this that I don’t quite understand why there are some data types that cannot be the type of a variable.

Details: For a game prototype I’m trying to make a character with the same skeletal mesh as the player character to retrace the movements of the player character. Also the animations and animation durations have to be the same. I’m trying to store location and animation information of the player character in short time intervals and reapply them to the other character. I also tried this with a recording sequence that records the player character, but I have no idea how to retrieve the recording data so I can apply transform data and animations of the recorded character to the other character.

Maybe someone has an idea that could point me in the right direction? I’d really appreciate it.

Ok, seems I made some progress. I searched in the Engine Source Code if I could find the class I want to have visible in my blueprint data types and looked up how to add custom structs via C++.

Here is my struct code:

USTRUCT(BlueprintType)
struct FAnimationAssetReference
{
	GENERATED_USTRUCT_BODY()

		UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Item)
		UAnimationAsset* AnimationAssetReference;

};

The problem is, in the Blueprint I have two different Types: The struct AnimationAssetReference for my Array ‘AnimationReferences’ where I want to store the animations and the AnimationAssetReference Type from the ‘Anim To Play’ Output pin from SingleAnimationPlayData.

How can I make those types compatible? Is this possible in Blueprints or can I make something like a cast function in C++ for this issue? I have no idea how to tackle this.

It took me sometime, but it seems like the following approach works: AnimationReferences is of my custom StructType which contains an AnimationAssetReference type variable.
I don’t want to close this topic just yet, because it feels like this is not the proper solution. I’d like to hear any thoughts on this:

I have found that I can store references to an animation asset in an editor-made struct using the type “Anim Sequence” (reference). I can for example make a data table of this struct and set an animation to each row, then get it in a blueprint script and play it.