Additive Reference Pose to clip cannot be used in builds

I have a scenario in which I’m using an animator with a lot of additive animations. In the editor, it is already possible to define a reference pose animation frame inside a specific animation:
7202506--864910--upload_2021-6-3_10-30-20.png

This creates an overhead though, because the animator would need to add a T-pose to all of the additive animations and then spend time configuring this animation in unity to not play in the actual animation itself. This becomes more problematic when using looping additive animations, where adding the reference T-pose breaks the curves and thus forces us to disable compression / resample curves.

A proposed solution by @Mecanim-Dev is to use the AnimationUtility:

Which would look something like this:

foreach (AnimationClip clip in clipsToUpdate)
{
    // Option A
    AnimationUtility.SetAdditiveReferencePose(clip, referenceClip, time);

    // Option B
    AnimationClipSettings settings = AnimationUtility.GetAnimationClipSettings(clip);
    settings.hasAdditiveReferencePose = true;
    settings.additiveReferencePoseTime = time;
    settings.additiveReferencePoseClip = referenceClip;
    AnimationUtility.SetAnimationClipSettings(clip, settings);
}

This solution has a few problems however:

  • It only works using editor code, so you can’t apply a reference pose at runtime
  • This value is NOT serialized, meaning that it only applies for your local machine, and when you restart unity or reimport the file, you would need to apply it again. When making a build, you’d also need to reapply it.
  • It doesn’t actually work when you make a build in -batchmode

I had already written code to constantly re-apply it to make it work in editor & normal builds, but it not working -batchmode either basically means that it is unusable and no longer a viable solution for us.

This “bug” might borderline on a feature request, but it seems like a very important & basic thing to want to do. I can’t imagine anyone that seriously uses additive animations wouldn’t want to have a reference clip instead of needing to do a whole bunch of extra work.

Bump, would really appreciate a response, a bug report was also made on this. (case 1340644)

Note again that the workaround I’ve created above only exists because a reference clip isn’t exposed properly by unity.

edit: This bug just got added to the public issue tracker:
Unity Issue Tracker - Animation Additive Reference Pose to clip cannot be used in builds (unity3d.com)