Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Difference between animation curves betwee Generic and Humanoid. What is going on underneath?

Discussion in 'Animation' started by Evgeni_Incineration, Sep 14, 2022.

  1. Evgeni_Incineration

    Evgeni_Incineration

    Joined:
    Jul 4, 2022
    Posts:
    25
    Hello everyone,

    I am trying to do editor-time animation analysis for our custom IK tech we are working on. Unfortunately my knowledge of animations, their important settings and difference between different animation types, is lacking (to say the least).

    I want to go through animation's key-frames curves and find out about its feet position in different frames.

    When I import animation as Legacy I get the full information for each curve, with path and propertyName using AnimationUtility.GetCurveBindings().

    Example print of single EditorCurveBinding with Legacy animation:
    Code (CSharp):
    1. (Path: DummyRig/root/B-hips/B-thigh.R/B-shin.R/B-foot.R/B-toe.R) [propertyName: $m_LocalPosition.z]
    When I change animation back to Generic or Humanoid I get no path only propertyName.

    Example print of single EditorCurveBinding with Humanoid animation:
    Code (CSharp):
    1. (Path: ) [propertyName: $RightHand.Little.3 Stretched]
    Both curves should be the same, they are the last curve in the animation.

    I understand that Humanoid is about re-targeting to generic humanoid rig. Is that what is going on?

    Thank you,
    Evgeni
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,070
    Yeah, a Humanoid animation is targeting the Humanoid bones, and has curves for those bones. A Humanoid model has a mapping from it's transforms to the humanoid transforms.

    Roughly.

    If you pass that EditorCurveBinding to AnimationUtility.GetEditorCurve, do you get out a sensible AnimationCurve?
     
  3. Evgeni_Incineration

    Evgeni_Incineration

    Joined:
    Jul 4, 2022
    Posts:
    25
    Hello Baste,

    Actually yes, there is sensible data inside. I just need to figure out how which property (Humanoid) matches the curves in the original animation.

    -Evgeni