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?
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.
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.
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.