questions about the Playable API refactor.

Hi,
I’m trying to get my head around the Playable API refactor and I have a few questions:

  • I’ve seen there’s a new GraphVisualizer here:GitHub - Unity-Technologies/graph-visualizer: Visualizer for your Playable graphs but it’s apparently a non experimental version the is not in the current beta. Should I use it in it’s current state or should I wait?

  • Before 5.6 we could add inputs to a playable on the fly but it seems that now we have to define the number of
    on inputs on creation, will this come back?

  • The CustomAnimationPlayable have disappeared, Am I right thinking the now we just have to just inherit from the main classes (AnimationClipPlayable, AnimationMixerPlayable…)?

  • Do you already have some examples around on how to use it?

Thanks
Ahmidou

Hi Ahmidou,
I was wondering the same thing. The code I had before 5.6b3 was working but now it can’t compile anymore.
No more Create, SetInputs, SetInputWeight function.
I would like to have some example as well, as I’m a bit confused how to use it.

I just want to create a simple key based animation system, so I can blend between them using this system.

Thanks !

FYI I’ve reverted to 5.5 until I have some clues how to reproduce my system on the new 5.6. I hope this will be better documented until the full release !

Cheers !

I guess we’ll find answers there very soon:

- I’ve seen there’s a new GraphVisualizer here:GitHub - Unity-Technologies/graph-visualizer: Visualizer for your Playable graphs but it’s apparently a non experimental version the is not in the current beta. Should I use it in it’s current state or should I wait?

You should wait. It’s not compatible with 5.6 beta, it’s intended for the timeline experimental build.

- Before 5.6 we could add inputs to a playable on the fly but it seems that now we have to define the number of
on inputs on creation, will this come back?

It’s preferable to set them on creation, but you can change them using the inputCount property on the playable handle. In fact, most of the methods you are looking for have been moved to the PlayableHandle struct, which, from the class is accessable through the handle

- The CustomAnimationPlayable have disappeared, Am I right thinking the now we just have to just inherit from the main classes (AnimationClipPlayable, AnimationMixerPlayable…)?

CustomAnimationPlayable has been replaced by ScriptPlayable.

- Do you already have some examples around on how to use it?

An update manual is coming. Here’s a small example to get you going…

           public AnimationClip clip1;
            public AnimationClip clip2;

            PlayableGraph m_Graph;
            PlayableHandle m_Mixer;

            public float mixLevel = 0.5f;

            public void Start()
            {
                m_Mixer = AnimationPlayableUtilities.PlayMixer(GetComponent<Animator>(), 2, out m_Graph);
                m_Graph.Connect( m_Graph.CreateAnimationClipPlayable(clip1),0,m_Mixer,0);
                m_Graph.Connect( m_Graph.CreateAnimationClipPlayable(clip2),0,m_Mixer,1);
                m_Mixer.SetInputWeight(0, 1.0f-mixLevel);
                m_Mixer.SetInputWeight(1, mixLevel);
            }

Thanks you Seant, it’s very helpfull!