How to use animation curves in c++?

I need some additional data connected to an animation montage. In the montage editor it is possible to add curves. I would like to access these trough c++ from a running animation. Normally they are used for morph targets/material parameters, so it should be possible.

I know that it’s possible to use data from an UCurveFloat, but it would be a lot easier to connect it directly to the montage, especially when there are mutliple sections.

I found the solution minutes later…

You can access the curve values with:

UAnimInstance * Animation = (Mesh->GetAnimInstance());
Animation->GetCurveValue(FName("Test"));

Didn’t test it yet, but it should work. Before I tried to access it from the Montage itself, not the AnimInstance.