Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Timeline - Available in Unity 2017.1

Discussion in 'Timeline' started by gekidoslayer, Feb 7, 2017.

  1. gekidoslayer

    gekidoslayer

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    134
    Timeline - Available in Unity 2017.1

    TimelineExample Dark.png

    Update: Timeline has been released as part of Unity 2017.1. Try it today!


    The Playables Example project has also been updated for the official Unity 2017.1 release

    We’re excited to share with everyone Unity's new Timeline sequencing system.

    Timeline is a new visual tool in Unity that allows the creation of cinematic content, cut scenes, gameplay sequences, complex particle systems and more. With Timeline you can organize a multitude of gameplay elements in separate tracks and orchestrate the play back easily deciding of the sequence of events.

    For more information about what Timeline & Cinemachine are and how to use them, check the four sessions recorded at Unite Europe; we’ve compiled a playlist for you:

    Finally, Timeline is extensible via the Playable API and offers the ability for you to create your own tracks to drive any system you have in your game.

    To get an overview of what Timeline can do, here is a preview from the Unite Seoul conference in May!



    Here is another video from GDC 2017



    Highlights
    • Animation Tracks
      • Root motion (externally authored clips)
      • Anim clip keyframing workflow, synchronized with Animation Window
    • Activation Tracks
      • Enable / disable Game Object’s within Timeline
    • Audio clip support
      • Target custom Audio mixers
    • Custom track support
      • Write your own custom tracks with the enhanced Playable API
    • Scripted Timeline control
      • Start, stop, ‘go to time’ and much more
    • Cinemachine integration (available from the Asset Store)
    Please refer to the Release Notes and Reference Guide below for more detailed information.

    Downloads
    Timeline is integrated in the Official Unity 2017.1 release!
    The latest Cinemachine is available on the Unity Asset Store:

    Release Notes

    Reference Guide
    Reference guide on features available in this release can be found here:

    Timeline / Playable API Examples
    There are 2 packages available to demonstrate Timeline and the Playable API. Each demonstrates different aspects and use cases of Timeline.

    Download Timeline Examples V2

    Default Playables (available from the Asset store)
     
    Last edited: Aug 4, 2017
  2. massivebacon

    massivebacon

    Joined:
    Apr 24, 2014
    Posts:
    27
    Sweet! Been really looking forward to this.
     
  3. ScottyB

    ScottyB

    Joined:
    Apr 4, 2011
    Posts:
    146
    @mikew_unity, the Example Projects YouTube video linked in your post appears to be unavailable. Is it still set to private by chance?
     
  4. gekidoslayer

    gekidoslayer

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    134
    Sorry Andy requested that I take it off temporarily, we'll redo it and add it back asap.
     
  5. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,741
    does this support scrubbing of mecanim animations like cinema director does.
     
  6. gekidoslayer

    gekidoslayer

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    134
    Depends on what you mean by 'scrubbing of mecanim animations'

    Timeline is meant to set up linear sequences of animations. It is built on the same underlying system (the Playable API) as mecanim. You can animate (and blend between) root motion animations for characters in a sequence, or you can do your own keyframing of animations directly within Timeline.

    Currently you can't drag a full Animation controller onto the Timeline and have it scrub the full state machine, although this is on the roadmap. However, you CAN blend seamlessly from state machines (ie gameplay) and a Timeline sequence (to blend into and out of cutscenes for example).
     
  7. ezone

    ezone

    Joined:
    Mar 28, 2008
    Posts:
    331
    Thanks guys - been waiting 10 years for this! Very excited to try it out. Cheers!
     
    TechDeveloper likes this.
  8. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,203
    Will it be available as a .dll like Cinemachine? compatible with 5.5?
    Also how do I skip, ffwd, restart a timeline sequence via code? What's the recommended way to transition smoothly from scene state to timeline sequence back to another scene state?
     
  9. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    This looks really nice. Hats off to you folks at unity for thinking about artists :)
     
    awesomedata likes this.
  10. AliAzin

    AliAzin

    Joined:
    Jun 25, 2009
    Posts:
    51
    Very nice,
    Any plan to add avatar masking in override track?
     
  11. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    632
    Any chance we can have a simple tween engine and a path waypoint system?
     
  12. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Yes, we have plans for that in a future release.
     
    twobob likes this.
  13. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Time and play controls are done through the PlayableDirector component. It has a scripting interface. Playing a timeline will automatically transition to and from scene state, and you can put ease-in/ease-out curves on your animation track clips to blend those transitions.
     
  14. DoctorShinobi

    DoctorShinobi

    Joined:
    Oct 5, 2012
    Posts:
    219
    It's looking pretty good. I wonder though, where can I get the gameplay examples project?
     
  15. gekidoslayer

    gekidoslayer

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    134
    We had a few last-minute issues with the gameplay examples project, it will be published again shortly.
     
  16. gekidoslayer

    gekidoslayer

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    134
    Re: control of a sequence at runtime - if you check the playables example project there is a demo of controlling a timeline from runtime, with UI 'player controls' as well - you can play, pause, rewind etc all from runtime.
     
  17. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,203
    Blending from a scene to a timeline is easy to understand but how do you define the out state? A new scene? And how do you take over game logic, it just works? (something tells me it's also related to this new Playable API)
    Sorry for just asking questions that may be answered by testing this demo you linked, I'm in the middle or breaking everything for an iOS port :) Good thing is one of the animatic is such a clusterf*ck of coroutines that I'm tempted to use Timeline on it. Could we get a 5.5.1 build?
     
  18. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,594
    So... clicking "Add from animation clip" shows me all animations in my project, which is horrible, and then when I click an animation, it crashes.

    Sooo... I guess I previewed the timeline feature!
     
    laurentlavigne likes this.
  19. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Would it be within the scope to make it possible to grab arms/limbs and animate character bodies and then morph their faces/textures while playing some audio with this?

    For the first part, I was thinking of using something like Skele to animate directly in the editor, though it would be much better if this could just be done natively. I have a feeling we could use lip sync to animate the mouths programmatically with approximation, and using morph data when more precision is required. The only thing left is morphing the faces to different shape keys for various emotions. With these three features, it would be possible for anyone to make cutscenes easily.
     
    Last edited: Feb 8, 2017
  20. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,646
    Sorry, it's not being backported to the 5.5 line.
     
  21. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    I want to try it out (probably will sometime), but will it continue to be updated alongside the 5.6beta releases?... this whole experimental preview thing does have its offputting drawbacks :)
     
    invadererik likes this.
  22. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    I strongly agree. Using Skele with Timeline is a very bad expirience as far as I can tell. Having some kind of controll over characters directly in the Timeline as in Source Film Maker will make it much more easier for us.
     
    awesomedata and laurentlavigne like this.
  23. Ziboo

    Ziboo

    Joined:
    Aug 30, 2011
    Posts:
    356
    Is is possible to Instanciate objects with a custome timeline ?
    I would really need something like that.
     
  24. gekidoslayer

    gekidoslayer

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    134
    It really depends on what you have animated in your sequence. Timeline does not 'take over' from standard execution logic or 'stop' anything from happening elsewhere in the scene at all. It entirely depends on what you have animated & 'bound' to the sequence.

    If you have an animated character with a state machine (ie your player) that you add to a Timeline, when the Timeline starts playing, the Animator will be overridden by Timeline to play the sequence. Once the sequence is done, Timeline will release control and the standard animation controller will be 'back in charge'.

    Note that while the Timeline is playing, it does not disable components or otherwise prevent things from executing - so if you want to disable input or stop the character from being affected otherwise you will need to handle these things either through a playable (see the example library for one way to do this) or simply by disabling the components from script otherwise.

    A couple of important things to remember:
    1) Timeline is not a master override system that takes over your normal Unity scene. You can think of it as just another tool in your belt to help you create things easier. Timeline sequences do not need to start on scene load, you can activate them very easily via Triggers or from other scripts on demand.

    2) You can have multiple Timeline sequences running at one time. In one of the demos I'm working on, every interactive object in a scene has it's own mini Timeline that controls how the object is interacted with. Doors opening, drawers opening, you name. I'll hopefully have time to grab some video examples of these workflows soon.
     
    twobob and laurentlavigne like this.
  25. gekidoslayer

    gekidoslayer

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    134

    There isn't a prefab spawner track yet, but it would be fairly easy to create a custom playable to do this. I'll see if I can get it added to the sample library ;}

    One of the team just reminded me that you can use Control Tracks to spawn prefabs in a scene.
     
    Last edited: Feb 9, 2017
  26. kukuhbasuki

    kukuhbasuki

    Joined:
    Apr 13, 2016
    Posts:
    29
    it's very similar to Flux on asset store
     
  27. gekidoslayer

    gekidoslayer

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    134
    In the very near future Timeline will support masking of animations which will allow for these kinds of bone-specific overrides during animation sequences. The end goal is to definitely provide a similar workflow to Source Film Maker and other similar tools.

    Performance recording (being able to 'play' the game and record sequences that you can modify afterwards) is also a highly requested feature and is on the near-term roadmap.
     
    Kolyasisan, ArthurT and awesomedata like this.
  28. zwickar

    zwickar

    Joined:
    Sep 3, 2016
    Posts:
    1
    Hello Mike,

    I do not understand what is happening. Here is what i did:

    1. created a box with an animator, animated it in the normal animation window.
    2. created a timeline asset, dragged the box game object into the timeline window from my scene hierarchy. And chose "Animation Track"
    3. dragged my animation file that I created in step one, onto the box game object in timeline. I can scrub the animation timeline and can see the box animate.
    4. now I want to go back to my original animation and change it in the normal way in the animation window. But now, when I scrub in the animation window, my object no longer animates, I can no longer turn on the "record" button, I can add keys but not edit the values, but I can modify existing keys.
    5. also if i add another animation it will not let me record animate it in the animation window. I can add a key manually using the "Add Property" button, but if I try to change a keys value, it will not stick.
    What is keeping me from editing an animators animation clip once the object is in timeline?

    Just noticed, if I right click a clip in timeline and choose "Edit in Animation Window", it does allow me to edit existing keys and add new keys to properties that already have keys but I cannot add new property keys. Scrubbing does work again )in the Animation window) but I still cannot use the record button.


    also, in the Timeline Manual, the "StoryTellerParticlesAnimation.unitypackage" link is broken. I'm trying to get my particle system to show all the parameters like the animated gifs show in the Manual but I cant figure it out.

    thanks,
    z
     
  29. gekidoslayer

    gekidoslayer

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    134
    Can you submit a bug report with an example animation that you are having issues with? We can take a look to see if there's anything specifically going on with the clips.

    What I would recommend is to do your keyframing work primarily in Timeline. You can use the 'edit in animation window' to modify existing keys but what I'd suggest for a workflow is:

    1) create timeline 'parent' object - this will hold the timeline 'Director' component
    2) drag whatever objects you want to animate onto the Timeline.
    3) hit 'record' for the object(s) that you want to keyframe
    4) set appropriate keys, set timing through Timeline itself
    5) if you want to tweak or adjust keys you can play with the curves directly in Timeline or use the 'Edit in Animation Window' to jump between the two. Note that the new box select and other features that the animation window provide will be unified going forward to help adjust keyframes in Timeline itself.

    Will dbl check the manual - the particles package is a bit out of date so I'm not sure whether it will behave properly in the latest builds or not.
     
  30. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    177
    We are aware of this issue; one of our field engineer had trouble setting keyframe values inside the Animation Window. We'll take a look at it. Thanks for the feedback!
     
  31. brianchasalow

    brianchasalow

    Joined:
    Jun 3, 2010
    Posts:
    208
    This seems like a bug:

    The UI of a Transform's XYZ are red in Timeline's preview mode, if that Transform has an animation track in Timeline.
    If you grab the associated GameObject that has a Transform position recorded animation in the timeline, and move it around in the scene, nothing is affected in the timeline.

    In non-timeline-land, with a traditional non-timeline animation in Unity, if you grab a gameobject that has a red Transform XYZ UI while in the Animation editor window, it will create a key in timeline and the animation editor will kick you into record mode.
    This seems like inconsistent behavior between two similar UI paradigms, no?
     
  32. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    75
    Very cool. We will definitely check this out. Thanks.
     
  33. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    This is intended. Properties in red indicate values that are being driven (previewed) by Timeline, not necessarily being recorded. It is inconsistent with the Animation Window right now, but it's a step toward where both windows are going. Future releases will distinguish between properties that are being driven and recorded.
     
    laurentlavigne likes this.
  34. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,458
    Man I can't wait to try this out. Will Timeline be able to save .anim files if we use it? Example I want to create an animation for my character when he is selected, and let's say, I have a sound of his weapon charging. Will this tool handle that? And also, could we integrate this with assets like UFE, for cutscenes?
     
  35. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,203
    Insert ripple is needed. On premiere, the shortcut is holding the command button while sliding a clip.
     
    Flurgle likes this.
  36. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    177
    Ripple edit is on our roadmap, stay tuned!
     
    laurentlavigne likes this.
  37. Flurgle

    Flurgle

    Joined:
    May 16, 2016
    Posts:
    389
    @julienb awesome! that's a must have feature.

    @mikew_unity Trying out the Timeline Preview. Looking really nice
     
  38. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,203
    You can keyframe a character directly in timeline when you create an animation track and reference the gameobject it's challenging. These improvements would help:
    1. show bones when an animation track is created
    2. fixing 'f' frame sending us far from a pivot that has no mesh
    3. shortcut to key all properties that already have a key ('k' in maya)
    4. prioritize bone over mesh and prefab in the selection
    5. key all objects in the scene by dragging the scene in the animation track instead of a gameobject
    6. <,> that work in the scene view (part of a larger topic of focus in unity which I'm sure isn't fun for the UT devs to hack through)
    I don't see Unity implementing a full body IK that allows us to pull arm and body moves like in Source FM but I know the mecanim folks are working on something that can be repurposed for that, the generic IK
     
    Flurgle likes this.
  39. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    You know what? I would be okay with manually positioning the limbs (in the meantime) as long as I could at least save/load poses for a gameobject's different chains of limbs/digits and mirror them where applicable. It wouldn't be quite as fast as dragging limbs with IK, but it would be precise enough for manual animation (and way less tedious) than having to pose every finger manually.

    Another point to consider -- Having a facial morph and lipsync palette would be nice for fast facial animation keys too. It would be a godsend if this included remembering/keying UV offsets and texture-swapping too, because animation of texture-based eyes and mouths (think anime/cartoon chars such as Unity-chan) is very tedious otherwise. As far as I have been able to tell, it is impossible to do the latter part in the Animation window anyhow. So this would be a HUGELY welcome feature of Timeline!

    --

    On another note: Is it possible to give gameplay characters going into a Timeline playable state an option to either use their current world location OR an absolute location (stored in the timeline itself) to start the position of their animation?

    To explain what I mean, I was thnking of the fight scene between the Blacksmith and the other guy. Let's say this guy the blacksmith was fighting was needed to be replaced by another gameobject sometimes and the blacksmith had started the conversation/fight scene with the guy from a weird spot (on top of a hill or building using something like Z-targeting). This would be weird because the choreographed fight requires very specific positioning of each of the two gameobjects. With them playing their animations separately at their current world locations, stuff would look pretty wonky.

    Let's say the blacksmith could get into skirmishes all over the world and different enemies could be needed or spawned when that animation plays -- Instead of baking the starting position of the gameobjects involved into the animation itself, I recommend allowing the user to position the gameobject and record this position (or enter it manually) as the absolute starting position for the animation for the current timeline. Otherwise, if nothing is recorded, assume they want to play the animation on the spot.

    --

    Regarding controllable characters and disabling components, I would suggest adding a Timeline Disabler component that would enable/disable all components except for the timeline -- BUT with the ability to populate an optional list of components to leave alone so that can control any audio or conditionals, such as getting hit, etc.)

    For example, add a public array of a gameobject's existing components in the inspector to be flagged (i.e. with a checkbox beside each array item) to flag them to be disabled when Timeline is active when this disabling component exists. It should have refresh/(de)select-all buttons that includes all components attached to the gameobject except for the timeline/disabler-component. Each gameobject attached to the Timeline gameobject as children could have this component attached too, and as long as either they OR their parent has a Timeline, they could subscribe to disabling their components (perhaps this could be specified too, since some gameobject children might want to only disable their components when they themselves have a Timeline, independent of whether their parent has one or not).

    Instead of everyone having to reinvent the wheel for such a common task/feature (as we already have to do with SO MANY OTHER features in Unity), why not help us out a little please? As long as I've waited for something like Timeline, I can wait just a little longer for it to work the way I (and so many others) would want it to.

    --

    PS: Totally stoked about the direction! SFM is a great inspiration for Timeline, and having a mechanism to finally be able to pose characters and set their faces for in-game cinematic sequences was the first thing that came to mind when you guys introduced Timeline! I love everything so far! Great work guys! :)
     
    Last edited: Feb 11, 2017
    KRGraphics likes this.
  40. ArthurT

    ArthurT

    Joined:
    Oct 26, 2014
    Posts:
    75
    If you check the Playables API Examples, it has a few custom playable track clips that do exactly the features you're requesting, such as teleport GameObject to a specified location or toggle components. It should be easy to expand on adding multiple GameObject support to these.
     
    awesomedata and Flurgle like this.
  41. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Would it be possible to set the framerate with timeline? For example, if I wanted to mimic something like stop motion or a limited 2D animation framerate, I would absolutely need this feature. Right now, cutout animation looks too procedural, but with a feature like this, one can truly mimic hand drawn 2D animation, but with the benefits of cutout-animation style production shortcuts.

    It's not just my opinion, but games today are getting a bit same-y looking, no matter what art style they go with. This would give Unity developers like me a little more room to wiggle in terms of presentation. It's like adding another dimension of personality to every existing art style.

    Implementation on a track-by-track basis would be best (assuming you considered this feature), since one wouldn't want audio to skip, nor would they want their code execution to be off by a few frames.

    Hopefully this is something that wouldn't be too hard to add, considering this involves time and timing, and the name of this awesome thing is TIMEline. Not to mention if Unity is getting into movie making, this is a standard feature of almost all software that generates frames in that industry. ;) ;)
     
    Last edited: Feb 13, 2017
    KRGraphics likes this.
  42. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,203
    Please rename "Playable Director" to "Timeline Director" or something with "Timeline" in it.
    Reference: audioclip, audiosource, animator, animator controller, animation clip
     
  43. gekidoslayer

    gekidoslayer

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    134
    you could create a playable that sets the target framerate - but this doesn't guarantee a fixed framerate though.

    https://docs.unity3d.com/ScriptReference/Application-targetFrameRate.html

    also note that you can set Timeline to whatever framerate you wish while building your sequences (settings icon on upper right of the timeline) - so you can switch from frames, seconds, or specific FPS for your keyframe timing. Internally we use our own high-precision counters to make sure that the timing matches what your authoring desires.
     
  44. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    417
    I haven't yet tested this, but I'm watching the video. I just wanted to know, does this mean we'll be able to create layered sequences? I noticed the cinematic in the video could be seen live while using a 1st person controller, so it can be used for giving life to the world(level), no? Also, will we be able to make complex animation behaviours using this along with mecanim? Like creating a sequence for run or walk animation which mixes blend shapes and other animations every some seconds? (without having to go crazy with the animator or programming), and then like play the sequence when the player presses the corresponding inputs?

    I ask because I have always thought detailed facial animations are quite important (and often neglected) and to be able to blend this easier would be great (and I'm not much of an animator or a programmer yet...).
     
  45. gekidoslayer

    gekidoslayer

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    134
    yes absolutely you can use this for much more than just 'cinematics' - there is nothing that dictates that Timeline must have control over the camera. Not only that, but you can have any number of separate sequences running simultaneously (and triggered independently) within a scene.

    In the scifi scene from the Unite video for example, there was a separate timeline for the ambient characters, the Mech's the character fight scene all running at the same time.

    Timeline runs on the same underlying 'playable' system that the core Unity animation system does. This makes it very efficient and capable of launching and evaluating potentially hundreds of playable graphs at the same time. Just like each character in a scene has it's own animation controller running it's own playable graph (the animation state machine), you can use Timeline to control and manage any number of ambient sequences in a scene at one time as you wish.

    Regarding facial animation, particularly bone-based animation, Timeline does not allow you to 'mask 'animation yet. This is coming in a release very soon. This will let you create facial animation sequences for dialog etc and layer it over other animations, or control specific bones (character arm etc) with IK and layer it over the main sequence (or over gameplay control potentially). There are a ton of very interesting possibilities that become available once we have masking implemented.
     
  46. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    @mikew_unity

    What I meant was the ability to set the framerate on a per-track basis.

    For example, say I have a character animation on one track of a timeline (that's supposed to be rigid-looking so that it resembles stop-motion), some audio on another, and so on, and I want ONLY the character animation to progress ONE frame for every 8 frames played on the timeline, while, at the same time, I have an FX animation that I want to play at the default rate (i.e. as fast and smoothly as it can) so that I can overlay this for a hitspark effect or something.

    Based on your response, it doesn't seem like this is possible to do. I know it can't be done in the Animation window either, nor should it be, since something like this should only be active during playback so that it retains the full amount of frame data resolution in case I choose to tweak its smoothness for either the entire length of the track across the timeline, or even for a few frames on the fly or something by changing the framerate for the track on the fly through code or some such.

    Bottom line is -- I'm not worried about the entire screen's framerate -- only the specific tracks/layers that control the character and FX. Does this make sense?
     
    Last edited: Feb 15, 2017
  47. Brad-Newman

    Brad-Newman

    Joined:
    Feb 7, 2013
    Posts:
    185
    Can you add events to a Timeline at runtime via script? Is the Playables API documentation coming back for 5.6?
     
    Flurgle likes this.
  48. gekidoslayer

    gekidoslayer

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    134
    The API for manipulating Timeline from runtime is pretty sparse at the moment, however we will be expanding it considerably as we move along (so you can add tracks and clips on the fly etc).

    Documentation for the existing Playables system is still available, however the system as a whole has been modified & expanded considerably for the Timeline implementation (adding script playables in addition to the animation playables etc).

    https://docs.unity3d.com/Manual/Playables.html
    https://docs.unity3d.com/ScriptReference/Experimental.Director.Playable.html

    Full documentation for the new API changes will be made available asap.
     
  49. Brad-Newman

    Brad-Newman

    Joined:
    Feb 7, 2013
    Posts:
    185
    Thanks. I'd love to see the ability to add tracks and clips at runtime in the near term. For example, a player constructs some game objects in an ordered linear arrangement during gameplay, and this arrangement is then saved as a timeline sequence and played back in real time. Any plans to share the roadmap?
     
  50. vertxxyz

    vertxxyz

    Joined:
    Oct 29, 2014
    Posts:
    108
    We're currently adding Tracks using reflection:
    Code (CSharp):
    1. public static void AddTrackToTimelineAsset (TimelineAsset asset, TrackAsset track){
    2.     MethodInfo addTrackMethod = typeof(TimelineAsset).GetMethod ("AddTrack", BindingFlags.NonPublic | BindingFlags.Instance);
    3.     addTrackMethod.Invoke (asset, new object[]{ track });
    4.     if ((asset.hideFlags & HideFlags.DontSave) != HideFlags.None)
    5.     {
    6.         track.hideFlags |= HideFlags.DontSave;
    7.     }
    8.     else
    9.     {
    10.         track.hideFlags |= HideFlags.HideInHierarchy;
    11.         AssetDatabase.AddObjectToAsset(track, asset);
    12.     }
    13. }
    And creating them by instancing them from a master TimelineAsset (SerializedProperty "m_Tracks".)

    I'd really love support for exporting tracks from TimelineAssets to be reused. Currently if you delete a TrackAsset you get null/missing refs from Timeline and deleting (assetised Tracks) through Timeline stops Unity tracking the asset entirely, though (correctly) doesn't delete the asset itself.

    Also cannot wait for the in-game recording.
     
    winxalex likes this.