Additive animations based on frame from reference animation bring in curves with value -1

I think this was a problem with 4.21 as well. I noticed my character’s animations were broken in 4.21 but worked properly in 4.20 and earlier.

Let’s say you have an animation A with curves X, Y, Z

Now you have an additive animation B that is additive based on frame 0 from animation A.

When you use animation B in an aim offset blend space, it’ll contribute curves X, Y, Z with values of -1.

I have debugged deep into the C++ code that reads the animation curves when processing animation nodes and the AnimSequence asset seems to think it has curves with the same name as the reference animation but all with a value of -1. When I view animation B in the editor it shows no curves as expected. Also I think it’s normally perfectly valid to have a curve with a value of -1. I rely on this for making my character’s gun sway in sync with the walking animations, for example.

I haven’t figured out a fix myself since the issue is with the asset itself containing data that it shouldn’t, not a bug in the animation code. Though it’s possible a bug introduced in 4.21 makes the curve reading code interpret the data incorrectly. I’m mostly familiar with debugging deep into the animation code and don’t know where to start looking for fixing the underlying issue.

A workaround would be to create a copy of animation A and remove all curves, and use it as the reference for additive animation B, but could add bloat to the project.