[SOLVED] Miss-matched HumanPartDofs when instantiating MuscleHandles

I am looking at ways of mixing externally streamed animation data with regular animations. I am currently working with the Playables API and the UnityEngine Experimental Animations.

I have hit an issue with the body part enumerations when creating MuscleHandles. For example, these will always work as expected:

mAnimationJob.LeftUpperLegInOut = new MuscleHandle(HumanPartDof.LeftLeg, LegDof.UpperLegInOut);
mAnimationJob.RightHandDownUp = new MuscleHandle(HumanPartDof.RightArm, ArmDof.HandDownUp);

In general, there are no issues in creating MuscleHandles for the arms and legs. However, if I try the same thing with the Body and Head HumanPartDofs like this:

mAnimationJob.SpineFrontBack = new MuscleHandle(HumanPartDof.Body, BodyDof.SpineFrontBack);
mAnimationJob.HeadTurnLeftRight = new MuscleHandle(HumanPartDof.Head, HeadDof.HeadRollLeftRight);

I get errors like this:

Assets\Scripts\PlayableAnimationExperiment.cs(93,70): error CS1503: Argument 2: cannot convert from 'UnityEngine.BodyDof' to 'UnityEngine.LegDof'
Assets\Scripts\PlayableAnimationExperiment.cs(107,73): error CS1503: Argument 2: cannot convert from 'UnityEngine.HeadDof' to 'UnityEngine.LegDof'

i.e. It's expecting a LegDof for SpineFrontBack and expecting a LegDof for HeadRollLeftRight for some un-intuitive reason.

Is this a bug, or am I missing something?

(Demonstration script attached. Unity versions 2019.2.0b2 and 2019.2.0b3 on Win10)

4587664--427645--PlayableAnimationExperiment.cs (9.15 KB)

This was due to user error - when instantiating MuscleHandles for the Head and Body parts, only the BodyDof part is needed. So my line

mAnimationJob.SpineFrontBack = new MuscleHandle(HumanPartDof.Body, BodyDof.SpineFrontBack);

...wouldn't compile, as I'd specified a HumanPartDof. This is unnecessary in the case of Head and Body parts, as the body part being referenced is explicit in the BodyDof (SpineFrontBack in the above case). This of course is not the case for Arm and Leg HumanPartDofs, as there is a need to differentiate between left and right limbs.

The correct way to do the above is:

mAnimationJob.SpineFrontBack = new MuscleHandle(BodyDof.SpineFrontBack);