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. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Don't miss out on the Unite LA Keynote for the latest information from Unity! Set a reminder!
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Cut between timelines

Discussion in 'Cinemachine' started by specular12, Sep 26, 2018.

  1. specular12

    specular12

    Joined:
    Jan 28, 2014
    Posts:
    3
    Hello!
    I'm having trouble cutting between timelines. Cinemachine seems to revert back to a 2 second blend, even though I have the default blend on the Cinemachine brain blend set to cut.

    I have a timeline with a looping wide shot and I would like to cut to another timeline cut scene with a dolly track (close up shot) whenever the player presses a button. Once the dolly sequence timeline is complete, the camera goes back to the looping wide shot timeline. The button uses PlayableDirector.Play() to start the timeline.

    It works, or cuts, the first time through. However, the 2nd, and subsequent, times the button is pressed Cinemachine does a 2 second blend instead of cut. Since the wideshot is in outer space showing a planet and the closeup is on the ground, blending doesn't work.

    I have tried: -customs blends set to cut between the two cameras
    -putting the wideshot camera on the 2nd timeline (dolly) for a few frames, but this doesn't work as Cinemachine is defaulting to a 2 sec. blend
    -setting the ease in / out to 0, as well blend curves on to manual and flat
    etc., etc.

    Is there a way to force the camera to cut?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,649
    All blend settings are ignored when it comes to vcams invoked from the timeline. Timeline controls the blending 100%. Can you show me the timeline that plays the close-up? And the code that invokes it? Does the 2-second-blend happen when the close-up starts, or ends, or both?
     
    Last edited: Sep 27, 2018
  3. specular12

    specular12

    Joined:
    Jan 28, 2014
    Posts:
    3
    Here's the whole timeline for the close up sequence.

    close up all.jpg
    That sequence is embedded in this timeline:

    close up deriviative timeline.jpg

    It is triggered at the end of this sequence, which basically goes to black for 20 frames and then fires the close up animation (the fade in from black is the derivative forward timeline). As you can see, the timeline calls the next timeline (forward derivative) with a script on an empty game object through an activation track and OnEnable() on the script.

    goToBlack.jpg

    Code (CSharp):
    1. public class RunAnimation : MonoBehaviour {
    2.  
    3.     public PlayableDirector[] cameraMoves;
    4.     public PlayableDirector goToBlack;
    5.     public TextControlOrbit textControlOrbit;
    6.     public Sprite[] camDirectionSprites;
    7.     public Image camDirectionImage;
    8.     public GameObject blackOutTrigger;
    9.  
    10.     void OnEnable ()
    11.     {
    12.             if (textControlOrbit.camDirectionCounter >= cameraMoves.Length) // safety check
    13.             {
    14.                 textControlOrbit.camDirectionCounter = 0;
    15.                 camDirectionImage.sprite = camDirectionSprites[0]; // fix sprite in case this fails safety check
    16.             }
    17.  
    18.             //keeps playable from getting stuck on last frame if the animation has already been played
    19.             cameraMoves[textControlOrbit.camDirectionCounter].Stop();
    20.             cameraMoves[textControlOrbit.camDirectionCounter].Play();
    21.  
    22.             blackOutTrigger.SetActive(false);  //turn off
    23.     }
    24. }
    The camera pulls back to the same spot the entire thing starts at, so I can't tell if there is a blend at the end. This solution works the first time through, but the second time the button is pressed, the timelines blend. So even though the timeline takes over camera blends within itself, what I don't understand is how do I control blending between timelines? Or is there a better way to handle this?
     

    Attached Files:

    Last edited: Sep 28, 2018
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,649
    Thanks for posting all that, but even so it's really hard for me to tell what's going on. Any chance you could post a stripped-down package that exhibits the problem? Then I could drill into it properly and help find a solution for you.
     
  5. specular12

    specular12

    Joined:
    Jan 28, 2014
    Posts:
    3
    Sure - however, I found a solution! There's a dolly cam with track in the second timeline. If I keep the dolly cam inactive, then use a coroutine to activate it one frame into the next timeline (ergo frame 2, not frame 1), it will cut instead of blend. It looks perfect and there are no glitches.

    If you still want a stripped-down example of the problem, just let me know.

    BTW, in searching for a solution, I switched from using an activation track with OnEnable to Timeline Events from the Asset Store to trigger the 2nd timeline. Timeline Events has been rock solid so far. https://assetstore.unity.com/packages/3d/characters/timeline-events-115300
     
    Gregoryl likes this.
  6. julienb

    julienb

    Unity Technologies

    Joined:
    Sep 9, 2016
    Posts:
    95
    There are some issues when using Activation Tracks and Control Tracks together. Playing nested timeline with Activation Tracks are causing problems because the playables generated for those tracks were ''fighting'' each other. Fixes for those issues are on the way.