Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

A few questions about custom playables in Timeline

Discussion in 'Timeline' started by Rtyper, Sep 20, 2017.

  1. Rtyper


    Aug 7, 2010
    I'm working on making my LipSync Pro plugin compatible with Timeline at the moment. Eventually, I'd like to actually incorporate the playables API into the whole system, but as a stop-gap for now I've created a playable that just exposes a reference to a saved LipSyncData (clip) object instead.

    I've noticed that there's a few nice features some of the built-in tracks have that I'd like to replicate though:
    1. The Add From... dropdown that then lets you choose an Audio/Animation clip for the new clip before adding it.
    2. The ability to set a max duration or prevent dragging the start further back than the length of the animation clip. Is there some way to do this, or even fixed-duration clips?
    3. Triggering something when a playable in the timeline starts playing rather than every frame. LipSync has Play and PlayFromTime methods that will work nicely. I've found the OnBehaviourPause and Play methods in PlayableBehaviour that would work, but as far as I know I can only access the track binding from ProcessFrame.
    Other than that, it's a nice system! I'm looking forward to using it more in my own projects as well!

  2. seant_unity


    Unity Technologies

    Aug 25, 2015
    Thanks for the feedback. 1 and 3 are definitely on our radar, and will hopefully have improvements in those areas in an upcoming release. Our goal is to provide customizers of Timeline better access to timeline-specific information from within their clips and behaviours.

    As for #2 - we don't support fixed-duration clips (it's a good feature request though), but what you can do is in your PlayableAsset representing the clip is override the duration property, to return the length of the LipSyncData. This will make the Reset set the clip length to that length, and when the user sizes the clip larger, the clip will show 'Hold' in the region past the length.

    If you want to support looping, you can do so but implementing ITimelineClipAsset and providing your own ClipCaps. Instead of 'hold', it will show 'loop' and give you the loop block visuals.