Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Question How do multiple AnimatonPlayableOutputs get blended together before applying to humanoid avatar?

Discussion in 'Animation' started by dawwo, Mar 21, 2024.

  1. dawwo

    dawwo

    Joined:
    Jul 19, 2023
    Posts:
    1
    When multiple AnimationPlayableOutputs are affecting the same animator sorting order handles priority, where the animator controller is set to always take precedence. But they seem to be blended together in some way before the animation is applied to the humanoid. In the documentation I could not find a description of the process.

    I took the example script from the MuscleHandle documentation page and modified to get this script that generates a PlayableGraph: AnimationPlayablesTest.cs

    When a single AnimationPlayableOutput affects the avatar I get similar behaviour to
    HumanPoseHandler.SetHumanPose(HumanPose pose)
    where Mecanim's retargeter recalculates the center of mass and *annoyingly* shifts the whole avatar.


    But, when I add a second PlayableGraph (In the example video I used the same script twice but I get the same effect with an empty Animator Controller and the graph that it creates) the final pose is a blend of the 2 outputs dictated by the weights and sorting order, but the bodyPosition as a whole is not. Instead it is stationary.


    Is this expected? The second case is the result I'm trying to achieve, but the vagueness in the documentation and previous tinkering with the rest of the Humanoid Pose system leads me to believe that this could be a bug. Is there anyone that knows the details of how multiple PlayableOutputs blend before the final result?

    I want also to preface that, yes changing individual Transforms rotations with raw Quaternions sidesteps all the quirks of muscles, but I'm creating a tool that interfaces with live motion capture data and needs to give devs control over individual body parts to create a discrepancy between real-world and virtual-world. And Mecanim muscles are a really nice abstraction that comes packaged with per model movement limits and other nice features. My goal is to implement an option to use them.
     

    Attached Files: