Search Unity

Can you set a Control Track Clip on "hold" mode ?

Discussion in 'Timeline' started by remiC3D, Mar 12, 2019.

  1. remiC3D

    remiC3D

    Joined:
    Dec 15, 2017
    Posts:
    30
    Hello,

    I have a small issue, and hope you guys can help me:

    I've created a "master" Timeline that simply has one Control Track.
    In this Control Track, there are two clips, that references two other timelines (positioned one after the other): "CubeTimeline" clip and "SphereTimeline" clip.
    • The CubeTimeline clip source game object is another timeline where a cube moves from position A to position B
    • The SphereTimeline clip source game object is another timeline where a sphere moves from position C to position D
    So far so good, I can play the master timeline from start to end, and see the cube move from A to B, then see the sphere move from C to D.

    But the trick is: in my game the user can jump to various times of the master timeline, using a classic time slider. And what happens is that, if he directly jumps to a point in time where the CubeTimeline clip has ended, the cube stays in its original position (A), which is probably due to the fact that the CubeTimeline clip is not played at all, and that I cannot put it in an "animation extrapolation mode : hold" mode, the same manner as I would do for an Animation Clip on an animation track.
    I think I've already tried all the available settings on my clips, tracks, playable directors, but maybe I'm missing something ?

    Has someone experienced similar issues and can help me ?

    Thanks in advance for your help !
     
  2. remiC3D

    remiC3D

    Joined:
    Dec 15, 2017
    Posts:
    30
    Nobody ?
    In simpler words, assuming you animate objects (transforms, components...) in a "slave" Timeline, and then put this slave Timeline as a clip in the beginning of the control track of a bigger "master" timeline, can you make it so that these object retain their ending values in the rest of the master timeline ?

    Thanks in advance !
     
  3. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Yes - the only easy remedy I'm aware of is to use extrapolation in the sub-timeline, and extend the length of the timeline (right click on the end marker, and switch the duration mode to fixed length). Then drag increase the length of the control track in the parent.

    This is an issue that you need to be aware of when using sub-timelines.
     
  4. remiC3D

    remiC3D

    Joined:
    Dec 15, 2017
    Posts:
    30
    Thanks for your answer seant_unity.
    I think I understood your Idea, and it should work in simple cases but I don't think I can apply it to mine. I did a quick setup to explain:
    These were my timelines (master and slave) setup before applying your solution:


    Now in this example, I want to animate a cube (say for example move it from position A to position B), then animate a sphere (from position C to position D), and I want the cube to retain its ending position (B) even if the user jumps to the end of the master timeline without playing it entirely (using a time slider for example).
    Likewise I want the sphere to go back to its starting position (C) if the user jumps to the begining of the master timeline.
    (note: of course I don't need to use slave timelines in such a simple case, but please imagine there is more than just an animated cube in each slave timeline)

    By trying to apply your solution (giving a fixed length to the slaves timelines), here is what I get:

    As you can see however, I can't follow your next step and increase the lenght of the CubeTimeline clip in the master timeline, because the SphereTimeline clip sits right next to it.

    As a workaround, I could split my master control track into two control tracks :

    And it works fine as long as the cube is concerned, but :
    • as you can see I lose all visual clue as to when the cube animation actually ends
    • what if I want the sphere to, likewise, retrieve its starting position, if the user jumps to the begining of the timeline (using a timeslider for example)
    Of course I guess I could manage to turn the sphere timeline into a kind of "infinite length" timeline too, but then I would lose all interest in having a master timeline to control the start and and of each of these slave timelines...


    Any other idea that could help me ?

    Thanks in advance !
     
  5. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    That is exactly my suggestion, and exactly the limitation with my suggestion (and the workaround). :)

    I wish I had a better answer that I could give you, in particular for the pre-evaluation of the sphere timeline. This is something we are acutely aware of. One solution is making sure each subtimeline has default poses for everything in the master, and admittedly, that's not a very good one.

    In 2019.2, we have exposed the functionality the control track uses to be a nested timeline. The intention behind that to be able to have custom/additional tracks that can solve exactly these type of issues. We've already prototyped a track/clip that allows nesting and supports extrapolation.

    Extrapolation doesn't solve all ills (because nesting only extends to the next clip), but this will open the door to many other solutions (for example, a mixer that detects when a clip has been skipped during scrub).
     
    remiC3D likes this.
  6. remiC3D

    remiC3D

    Joined:
    Dec 15, 2017
    Posts:
    30
    Thank you, seant_unity.

    FYI sebastienlh gave me the same answer in that post (sorry for doubling theads btw, it was originally a separate issue). The video sample he gave me can be used as a "step to reproduce" if needed.

    We will then follow your advice and avoid using Control Tracks for this specific use, at least for now.

    Thank you both again for your help in any case, it was much appreciated.
     
  7. LocalsOnlyCoop

    LocalsOnlyCoop

    Joined:
    Mar 8, 2019
    Posts:
    9
    Well I don't suppose anyone has found a better solution to this two years later. I have the same problem with a massive collection of ControlTrack assets. The user should be able to skip around from one point in the timeline to the next, but it doesn't resample the control tracks it skips off of.

    Which is completely useless.
     
  8. remiC3D

    remiC3D

    Joined:
    Dec 15, 2017
    Posts:
    30
    No I didn't find any solution to this issue, and I had to get rid of control tracks instead unfortunately.