Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

What is Animation Pose playable?

Discussion in 'Animation' started by Xaon, May 21, 2020.

  1. Xaon

    Xaon

    Joined:
    Feb 28, 2013
    Posts:
    62
    Hello.

    I'm trying to recreate Mechanim 2d blend with playable graphs. So far I have something workable that is based on 3 animation mixers. I'm thinking that this can be done better so I've checked what graph Mechanim produces. Mechanim does 2d blend with single AnimationMixed but it uses Animation Pose node. I cannot find information on what this node is. IT doesn't refer any clip. I also don't have any additive poses set up in anim clips if that even matters here. So my question is what is this Animation Pose node and can I use it to make my custom playable graphs better?

    upload_2020-5-21_20-16-58.png


    Mechanim also creates additional branch of AnimationMixers with empty clips that doesn't seem to be used, so I think we can skip that.
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,554
    I suspect that if you transition from A to B then interrupt that with a transition to C, it uses the pose node to store the current pose so it can simply transition between that pose and C instead of needing to create more playables to blend between all 3 at the same time. But I've never seen a playable type to create them in scripts and haven't actually looked into it. In Animancer I just let each state keep its own playable so it has no trouble blending between any number of states at a time.

    You might be able to find out more by getting the root playable from the graph and traversing its connections out to the pose node then using the GetPlayableType to find out what it actually is.

    While you're doing that, you might be able to find out something I've been curious about but never bothered to check: does Mecanim actually create and destroy playables when changing states or does it just keep unused ones disconnected from the graph (which causes the graph visualiser to not show them)? You should be able to find out by just getting one of the active clip playables then checking if it's still valid after going to another state in the Animator Controller.
     
    jjbish, xujinm and Xaon like this.
  3. OndrejP

    OndrejP

    Joined:
    Jul 19, 2017
    Posts:
    303
    AnimationPose is actually some internal playable implemented in native code.

    My guess is that it stores default animation pose. AnimatorController has this feature that when some animation is missing some bones, it uses something called default pose for these bones. Default pose is sampled when Animator is enabled.

    This is mostly visible when you disable animator in the middle of some animation, then enable it again and play animation which has less bones. The missing bones will be forced to position when the animator was enabled and default pose was sampled.

    I'm not sure why AnimationPosePlayable was not exposed to us, so we have same tools to making our playables as people behind AnimatorController, but it can be implemented with AnimationScriptPlayable.
     

    Attached Files:

    jjbish and liwest511 like this.
  4. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    229
    Can it be implemented? Because not only transforms but also properties and Renderer MaterialPropertyBlocks are controlled by the animator. Such implementation would be pretty useful, but idk how to implement it.
     
    Last edited: Oct 20, 2022
    Catsoft-Studios likes this.