Does anyone know how to work with the AnimationMixerPlayable in Unity 5.6?
There’s a very nice graph visualizer for the Playable system here, made mostly by @DavidGeoffroy , but it’s fairly outdated. It works up to 5.5, but changes in 5.6 broke it.
It was pretty trivial to update the visualizer to work just fine in the 2017 beta, but I also want it to be compatible with 5.6, and I can’t for the life of me figure out how I’m supposed to get a 5.6 AnimationMixerPlayable into a PlayableGraph.
In 5.5 and earlier, the graphs were internal, so you just create the mixer and add stuff to it:
var root = AnimationMixerPlayable.Create();
var node = AnimationClipPlayable.Create(clip);
root.AddInput(node);
In 2017, you instead create a graph and work with it:
graph = PlayableGraph.Create();
root = AnimationMixerPlayable.Create(graph);
var node= AnimationClipPlayable.Create(graph, clip);
graph.Connect(node, 0, root, 0);
But 5.6 is in-between. You connect stuff through a graph, but there’s no AnimationMixerPlayable.Create method. There’s two possibilities I can see:
- creating a new AnimationMixerPlayable(), and connecting it to the graph. But there’s no way to do that which I can find. Indeed, the system complains that I haven’t used a .Create method to work with the playable.
- using graph.CreateGenericMixerPlayable(), but the object returned is a plain Playable, not any kind of mixer.
Did the experimental playable system break in 5.6, or am I missing something? I could just skip the 5.6 stuff, but I kinda want it in for completeness.