Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  4. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Timeline - Available in Unity 2017.1

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

  1. mikew_unity

    mikew_unity

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    79
    There will be an API for building Timeline tracks at runtime (we have the preliminary version working in-house).

    Working on a public-facing Roadmap, will have initial pass to share soon..
     
    Alverik and HeadClot88 like this.
  2. HulioVR

    HulioVR

    Joined:
    Feb 11, 2016
    Posts:
    2
    Hi, is there good way to use array of objects in Playable? ExposedReference<GameObject>[] is hidden in inspector. Now I'm using ExposedReference to script which contains Array of GameObjects, but it's not the best way.


    Code (CSharp):
    1. using System;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEngine.Playables;
    6. using UnityEngine.Timeline;
    7. [Serializable]
    8. public class MaterialArrayChangeColorPlayable : BasicScriptPlayable
    9. {
    10.     public ExposedReference<GameObjectContainer> gameObjectContainer;
    11.  
    12.     private GameObjectContainer cont;
    13.     private GameObject[] gameObjectsArray;
    14.  
    15.     private MaterialPropertyBlock block;
    16.  
    17.     public override void OnGraphStart()
    18.     {
    19.         cont = gameObjectContainer.Resolve(handle.graph.resolver);
    20.         gameObjectsArray = cont.gameObjects;
    21.     }
    22.  
    23.     public override void ProcessFrame(FrameData info, object playerData)
    24.     {
    25.         if (handle.time == 0)
    26.             return;      
    27.     }
    28. }
    29.  

    Code (CSharp):
    1. using System.Collections.Generic;
    2. using UnityEngine;
    3.  
    4. [Serializable]
    5. public class GameObjectContainer : MonoBehaviour {
    6.  
    7.     public GameObject[] gameObjects;
    8.  
    9. }


    Will multi-object editing of Playables be supported? In my case I'm animating tens of objects (mainly their color), and changing anything in Timeline editor is super slow. Best way for me now is to keep variables (in this case Colors) in scripts.
     

    Attached Files:

  3. Christine_R

    Christine_R

    Unity Technologies

    Joined:
    Feb 15, 2017
    Posts:
    9
    More complete set of editing manipulations are on the roadmap. Stay tuned.
     
    laurentlavigne and HulioVR like this.
  4. KnightsShadow

    KnightsShadow

    Joined:
    Jan 21, 2013
    Posts:
    14
  5. ScottyB

    ScottyB

    Joined:
    Apr 4, 2011
    Posts:
    127
    @mikew_unity, any update on the progress of the new Example Projects YouTube video?
     
  6. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    580
    Instead of double-posting, I'll just link to my post that apparently got overlooked:

    https://forum.unity3d.com/threads/timeline-experimental-preview-release-1.455265/#post-2959622

    To summarize, I wanted to know, will we be able to set the rate of frame advances on a per-track-basis in the Timelines attached to our gameobjects?

    For example, rather than firing code (or, more practically, displaying the next frame of a 2D sprite rotation) at frame 0.357086, we could make it happen at specific intervals. For example, only fire code for this frame if the current frame is >= 0.5, then don't fire it anymore until it advances to 1, then fire the code again -- this would effectively allow us to fire code or change the frame of animation to the next one at every 0.5 frames.

    Pretty please, with cherries on top??
     
  7. mikew_unity

    mikew_unity

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    79
    Sorry everyone, been buried in GDC prep.

    You could update an individual track with a custom playable that controls when a track should advance. For sprite based animation I could definitely see this being useful.

    Example projects will be updated likely after GDC, don't think I'll have time to investigate the issue that was blocking release before then unfortunately.
     
    awesomedata likes this.
  8. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    580
    @mikew_unity

    Thanks for taking the time to reply! Sounds like a great start! -- Might this sprite rotation use-case even be a good, practical, base for a custom playables example when you guys get time to update?

    Oh, one other question! -- could the custom playable technique also be used, for example, to simulate stop-motion using 3D model animations too (i.e. by skipping some of the automatic smoothing/tweening between frames) by any chance? For this to work, it would effectively need to jump to the specific frame location, say, ~0.5 frames ahead (using my previous post's sprite rotation example as a reference, except replacing the sprite frames with 3D model limb rotations instead.)
     
  9. mikew_unity

    mikew_unity

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    79
    yes absolutely. how a playable works is that it runs a 'PrepareFrame()' method when time advances. It is up to you to determine what that means for your particular track.

    One of the playable values is the current time, which you could use to cycle a flipbook or whatever custom information you desire at the appropriate time markers / intervals.
     
    awesomedata likes this.
  10. mikew_unity

    mikew_unity

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    79
    the handle that is returned from the Playable can provide all kinds of useful information such as the currentTime, speed that the timeline is running at, delta time from the previous frame, duration of the entire timeline and so on. Shouldn't be too hard to manipulate the output accordingly.
     
    awesomedata likes this.
  11. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    580
    That's great!! Unity's animation system has been a thorn in my side for so long when trying to create any unconventional or nonstandard types of animations within a reasonable block of time! I'm loving this thing more and more every time I hear about it! I can't wait to give it a proper try! :D
     
  12. efruchter-within

    efruchter-within

    Joined:
    Dec 14, 2016
    Posts:
    2
    luispedrofonseca likes this.
  13. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    392
    Hi, have a question. Would it be possible to create 2D animated 10 min films ( movies ) for Youtube with this tool? Possibly whole 2h movie. Will the timeline handle such a complex task with tons of tracks?
     
  14. mikew_unity

    mikew_unity

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    79
    We are working on updated builds, this shouldn't be a problem, we have been working on keeping the Timeline branch sync'd up with the main 5.6 beta builds.

    Timeline does not have output / export functionality built in - it's somewhat out of the scope for Timeline itself, however the team at Unity Japan created this plugin:

    https://github.com/unity3d-jp/FrameCapturer

    It is designed to let you export png / mp4 / gif movies from within Unity. Quite a few of the early Timeline customers have been using this system with success to output movies from Timeline.
     
    twobob, Alverik and Gametyme like this.
  15. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    392
    Hi,

    For sure I understand that timeline itself does not have export capability. I was asking if the timeline editor in unity can handle more complex tasks than just cutscenes? As I see we can have something like master timeline that controls sub timelines which seems promising.

    Regarding the FrameCapture. Is it possible to export 4k videos? How about sound? Do we need to do post sound production in video editing tool?

    Thank you very much, Marek.
     
  16. a-quaihoi

    a-quaihoi

    Joined:
    Nov 17, 2015
    Posts:
    5
    does this work for 2D ? I should watch the video huh . . . okey dokey
     
  17. VargaPD

    VargaPD

    Joined:
    Mar 6, 2015
    Posts:
    61
    Dear Unity Team,

    I am really happy with the Timeline preview! It is so much easier to use, it makes a lot things easier. I really like it.
    However, I can't figure it out how to make animations blend with root motion. Or just two animations follow each other without blending. I would like to start the second animation from the position where the first stopped. If I set the Track offset, the second starts from there too, and I don't think that setting every clip's offsets would be precise...

    Thank you in advance!

    (PS: I think others asked something like that before in this thread, but my English is not so good to fully understand it)

    (PS 2: I'm not only asking the devs, if some of the users could help me too :) )
     
  18. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    367
    Silly question but, If I stuck to using this preview build, is it alright to publish a project with it? Or are there issues building? Or it's simply that there's no guarantees? Has anyone tried to publish a full project (even if small) using the Timeline preview build?
     
  19. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    392
    Also the question is what you mean by it won't land in 5.6? Does it land in 5.6.1 or Unity 2017?
     
  20. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    386
    Unity 5.6 is the last 5.x version so probably Unity 2017.x
     
  21. Fiery1

    Fiery1

    Joined:
    Oct 11, 2013
    Posts:
    11
    The particle workflow in Timeline is so close to being awesome. The ability to scrub the particles within the timeline preview is a critical workflow feature. I'd like the activation, playable, and animation tracks to turn on and off particle emitters in preview mode the same way the control track does. Is there an easy way to do that?
     
  22. Fiery1

    Fiery1

    Joined:
    Oct 11, 2013
    Posts:
    11
    When I edit a clip's Blend Curves in the Curve editor, the changes don't "stick", and aren't updated in the Blend Curves window. Is this a bug?
     
  23. VProFX

    VProFX

    Joined:
    Jun 10, 2013
    Posts:
    2
    Will there be support for playing video using the new video player on the timeline? It would be great to be able to synchronize video with 3d animation.
     
  24. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    94
    Support for video in the timeline is on our roadmap! Stay tuned!
     
  25. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    94
    Here's a little script that could help you, if you want to scrub the particles in a Playable Track. Add this to your project, then create a new Playable Track and put a new ParticleControlClip on it.
    Code (CSharp):
    1. [System.Serializable]
    2. public class ParticleControlClip : PlayableAsset, ITimelineClipAsset
    3. {
    4.     public ExposedReference<GameObject> exposedReference;
    5.     public uint particleRandomSeed;
    6.  
    7.     // Factory method that generates a playable based on this asset
    8.     public override PlayableHandle CreatePlayable(PlayableGraph graph, GameObject go)
    9.     {
    10.         GameObject sourceObject = exposedReference.Resolve(graph.resolver);
    11.         ParticleSystem particleSystem = sourceObject ? sourceObject.GetComponent<ParticleSystem>() : null;
    12.         if (particleSystem != null)
    13.         {
    14.             PlayableHandle handle = graph.CreateScriptPlayable<ParticleControlPlayable>();
    15.             handle.GetObject<ParticleControlPlayable>().Initialize(particleSystem, particleRandomSeed);
    16.             return handle;
    17.         }
    18.         return graph.CreatePlayable();
    19.     }
    20.  
    21.     // Use this to tell the Timeline Editor what features this clip supports
    22.     public ClipCaps clipCaps
    23.     {
    24.         get { return ClipCaps.None; }
    25.     }
    26. }
    To turn on and off a particle system, use the Activation Track.
     
  26. MargauxDR

    MargauxDR

    Joined:
    Mar 2, 2017
    Posts:
    1
    Hello there,
    I'm starting to use Timeline and I do have a (silly ?) question.
    I have my Timeline properly set up, playing animation clips (already recorded from an other software), activations tracks, and so on.
    I wanted to animate a camera, so I dragged and dropped the camera into timeline, created an animation track, and hit record. Everything works perfectly when I scroll the timeline (I can see the animation). But when I "play the game", the camera doesn't move.
    Everything else animated in the timeline works fine, but the camera move.
    I tried it differently, recorded a clip first OUT OF Timeline, and drag and drop it into Timeline : same issue, when I scroll the Timeline I can see the animation, but not when the game plays.

    Any hint ?
     
  27. Fiery1

    Fiery1

    Joined:
    Oct 11, 2013
    Posts:
    11
    Thanks for the script! It does allow me to preview VFX, but it creates strange bugs with the lifetimes and rotation over life on child particles both in preview and when playing the scene. The same thing happens if I use a Control Track to trigger the VFX.
     
  28. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    94
    You can use this build to publish a project, although I would not recommend it; this build is not production ready and we offer no guarantee regarding project compatibility between versions.
     
  29. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    94
    Do you have a list of the exact steps that would reproduce the issue?
     
  30. Fiery1

    Fiery1

    Joined:
    Oct 11, 2013
    Posts:
    11
    1. New Scene - add VFX_Test to hierarchy
    2. Create/Timeline/Timeline
    3. Add track to Timeline, select playable
    4. R-click in track, Add clip -> ParticleControlClip (Make it at least 5 seconds long)
    5. Drag VFX_Test onto "Exposed Reference" slot
    6. Select VFX_Test in hierarchy and simulate. Notice the lifetimes exceed 5 seconds, there is a steady pulse of the orange particle , and steady of rotation over time of blue particles.
    7. Play the clip in preview mode. Notice that all the particles die within 3 seconds, and that both the loop rate and the rotation rate rapidly accelerate over time.
    8. Play the scene and notice the same incorrect particle behavior.
     

    Attached Files:

  31. mikew_unity

    mikew_unity

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    79
    If you right-click on an animation clip you can choose 'match offsets to previous' which will automatically set the root offsets for the additional animations.
     
  32. thierry_unity

    thierry_unity

    Unity Technologies

    Joined:
    Jun 10, 2015
    Posts:
    149
    @Fiery1
    I just opened a bug in our database with that issue. we will investigate that and thanks for the report.
    Bug #888010 for future reference.
     
    twobob likes this.
  33. Fiery1

    Fiery1

    Joined:
    Oct 11, 2013
    Posts:
    11
    Awesome, thanks!
     
  34. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    392
    Hi, can we have preview release for 5.6f1 when it is out? We want to start dig into 2D short movie production. Also one question : Is there any solution for timeline to tackle multilingual ( variable lengths ) characters dialog audio clips?
     
  35. VargaPD

    VargaPD

    Joined:
    Mar 6, 2015
    Posts:
    61
    Thank you, it's working :) But blending two together still not. I hope it will be in the final release :) This is a very useful tool, I really like it :)

    Edit: Sorry, just realised an easy workaround. Set the first clip's end where the second should start, 'match offsets to previous' and then reset the first clip's end where you want it to be. (Sorry about my english, I can't explain it better :( )
     
  36. Fiery1

    Fiery1

    Joined:
    Oct 11, 2013
    Posts:
    11
    Is there an easy way to animate opacity for a mesh through timeline? I'm hoping for the ease of opacity animation in After Effects. I've tried animating the opacity of the mesh's material opacity through an animation track, but I can't get that to work through timeline. Suggestions?
     
  37. mikew_unity

    mikew_unity

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    79
    if you drag the clips so they overlap it will blend multiple root motions together, using the offsets - we've used this in every demo so far that we've put together.

    It should be as simple as exposing the material opacity via a custom playable, although I haven't tested it. will give it a try and see if I can come up with an example script to demonstrate.
     
    Fiery1 and Alverik like this.
  38. Fiery1

    Fiery1

    Joined:
    Oct 11, 2013
    Posts:
    11
    Is there any profiling data regarding Timeline's impact on performance? I'm interested in both runtime impact and load times.
     
  39. mikew_unity

    mikew_unity

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    79
    Under the hood, Timeline uses the Playable API, which is the same system that runs the main animation system in Unity. It is designed to be very lightweight and fast. I don't have specific stats currently though.
     
  40. Fiery1

    Fiery1

    Joined:
    Oct 11, 2013
    Posts:
    11
    That's good to know. It'll make our engineers much happier! :D
     
  41. Fiery1

    Fiery1

    Joined:
    Oct 11, 2013
    Posts:
    11
    Any luck with a custom playable? What would be AWESOME is to have an opacity control in the activation track!
     
  42. haskins

    haskins

    Joined:
    Oct 11, 2013
    Posts:
    23
    Hello all!

    Here's a 'Getting started from scratch' tutorial for Timeline, featuring Cinemachine and Post processing stack.


    *Links in video descriptions

    Folks on this thread may already have things running of course, but if you have a buddy that needs some help, I think this video will bring them up to speed quickly.

    I'm having a great time experimenting with Timeline! Being able to compose a scene visually and rearrange shots and actions on a timeline is very nice.
     
    Alverik likes this.
  43. garciapablo1959

    garciapablo1959

    Joined:
    Dec 20, 2016
    Posts:
    1
    Really amazing feature. THANKS YOU, keep up the good job. Cheers!!!
     
  44. faraz

    faraz

    Joined:
    Aug 4, 2014
    Posts:
    46
    WOW! this is something great feature i see today.. :( i am too late to get this news.
     
  45. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166
    Is that possible let Timeline only override specific layer in the animator controller?

    For an example, a character has two separated layers, one is "Base Layer" is a default one and the other is a created one for upper body. And the character's locomotion is done within the animator controller via animator state. i.e. The character has idle and walk state and those are linked with transition with a few animator parameters.

    If I want to add a wave animation which is done only on the upper body layer with Timeline. Is that possible?

    The senario is that moving the character is handled by animator controller and some other instance animation like waving hand by Timeline. So at the end of waving hand, the character animation automatically back to the idle state or walk state depends on the state in the animator controller.

    Best,
     
  46. winxalex

    winxalex

    Joined:
    Jun 29, 2014
    Posts:
    87

    The best way Unity handle things by good "contracts". Close everything so you need to reflect everything.
     
  47. winxalex

    winxalex

    Joined:
    Jun 29, 2014
    Posts:
    87
    Could you give us light of ExposeReference (seem like the way to expose scene element to assets) and how we create solver inside Asset(ScriptableObject) so we can solve scene references. Some small example will be great.
     
  48. winxalex

    winxalex

    Joined:
    Jun 29, 2014
    Posts:
    87
    Could show use use of AnimationMixerPlayable seem not working in U5.6b11
     
  49. alanmthomas

    alanmthomas

    Joined:
    Sep 7, 2015
    Posts:
    65
    This is possibly a very stupid question, but how well optimized is this for use in mobile projects? I just got through building a custom camera system that Cinemachine could have handled easily. Coupling it with timeline would make some cutscenes and transitions much easier as well.

    Also, to be clear, this is not slated for inclusion in the release version of 5.6? My project will likely be finished well before the Unity 2017 release so, if it isn't something that will be available, I'll likely not spend the time integrating it.

    Having said that, thanks for all of this. Unity continues to amaze me. Keep up the great work!
     
  50. mikew_unity

    mikew_unity

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    79
    Couple of points to help clarify:

    - Timeline is going to be released with 2017.1
    - Cinemachine is available now and backwards compatible back to 5.4

    It's only if you are wanting to use Cinemachine WITH the Timeline integration, you'll obviously need a Unity build with Timeline available, but the core of Cinemachine is actually available now / today with the current public versions of Unity.

    This means that you could use the gameplay Freelook cameras, or the existing virtual camera environment for your camera systems for everything 'but' the animation / blending of the cameras on Timeline (obviously).

    Both Timeline and Cinemachine are meant to be very lightweight - the only aspect of Cinemachine that might cause issues on mobile is the new collider module (which isn't publicly available I don't think) - this does collision checking to make sure camera's don't go through walls etc using raycasting. We are aware that some mobile teams prefer not to use the built in physics systems on mobile (including raycasting) for optimization purposes, so are investigating the best way to handle providing similar functionality for mobile-optimized collision.
     
    ManjitSBedi likes this.