Search Unity

Questions regarding a custom Timeline playable implementation.

Discussion in 'Timeline' started by DriesVienne, Jan 18, 2018.

  1. DriesVienne

    DriesVienne

    Joined:
    Jun 22, 2013
    Posts:
    27
    Use Case


    Manipulate a Transform, then when the clip has passed, the Transform should retain the manipulation.
    Call them 'Additive Clips' if you will.


    At times I wanted to post a question here, but writing out a post cleared my thoughts every time.
    The result though, was a rather thorough writeup of my progress, and the resulting prototype.

    We are now giving it a spin, and if all is well, we want to use it in production of our next project.
    It would be nice to have some feedback on the current implementation, since I don't want to run into trouble down the line.

    You can read the post here: https://dreezn.blogspot.be/2018/01/prototyping-custom-clips-in-unity.html

    The Questions
    • The obvious one: Did I use the correct approach in getting clip start/end times in the mixer, or is there a 'supported' way of having these cumulative transformations work using custom Timeline Playables?
      I feel like I'm jumping through hoops to get this use case to work.

    • As mentioned in previous forum posts, funneling values from the mixer through to behaviour is a workaround, and feels like misuse of the Playable API's architecture.
      What are the implications of working with this solution, and more importantly, is this advisable in a production setting?

    • It would be nice to have more context about the CustomTransformationTrack.GatherProperties' override, adding Editor code as present in some of the Default Playable package's examples, but not in all of them. The Default Playable's wizard did not create this code for me, so I gather it's not needed. Still I'd love to have some insight in whether or not I should include it in my use case, and why.

    • Setting default values of custom timeline clips.
      As I mention in my blog post, it appears that new clips now get a length of 300.
      It would be nice to set this somewhere.

    • The meat of a clip's template contents we extracted in a ScriptableObject, that way, instead of setting each template manually by hand for each clip, we can simply reference an asset there, this asset can then be re-used across multiple clips, making the workflow much faster and modular.
      Would it be possible to handle dropping such an asset directly on a track, as this is supported with AudioClips?
      (I have noticed however, that dropping an AudioClip on an existing audio track always creates a new track. I'd expect it to add a clip to the existing track instead)
     
    Ganosal likes this.
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Great blog post! That's the first custom example I've seen where the clips are accumulative.

    To answer your questions:

    Yes. That is definitely an area of improvement that we would like to address, and make this information more readily available to clips.

    If I understand the question correctly, there's no harm here. Passing data through the CreateTrackMixer means a runtime it will only be set once (the editor rebuilds the graph frequently). You touched on the issue in your post - accessing the timeline clip means you have access to any modified clip times without rebuilding the graph. That's handy in this situation but can be dangerous in others.

    As for the ordering of the clips and the mixers input playables. The editor does sort the clips by time for drawing and blending purposes - which means the playables have the same sorting - but it's not necessarily a guarantee that they are sorted, just that it's very likely if they were authored in editor. Because the clips accumulate this is a use case where that very much matters. We should either guarantee the sorting, or expose the ability to sort the clips.

    This is a mechanism for you to tell the editor which properties on the binding (transform in your case) the timeline will modify. You should include that code to prevent timeline from modifying the scene unnecessarily.

    Override PlayableAsset.duration in your Clip.

    Agreed - An overhaul for the drag and drop for custom types is planned for a future release.
     
    Ganosal likes this.