Search Unity

Timeline clip ease-in/out clamped to 0.49 of the duration of the clip - Why?

Discussion in 'Timeline' started by FracEdd, Jan 22, 2018.

  1. FracEdd

    FracEdd

    Joined:
    Aug 25, 2017
    Posts:
    3
    Hi,

    This is more of a question for the unity team than the community.

    Today we spotted that the timeline clip ease in and ease out durations are clamped to half the duration. Upon delving into the assembly I can see that the not only is the UI clamping the value, but the getter in the runtime is also clamping the value to of 0.49 of the clip duration, so there is no way of overriding it through the debug inspector.

    Code (CSharp):
    1. public double easeInDuration
    2. {
    3.     get
    4.     {
    5.         return (!this.clipCaps.HasAny(ClipCaps.Blending)) ? 0.0 : Math.Min(Math.Max(this.m_EaseInDuration, 0.0), this.duration * 0.49);
    6.     }
    7.     set
    8.     {
    9.         this.m_EaseInDuration = ((!this.clipCaps.HasAny(ClipCaps.Blending)) ? 0.0 : TimelineClip.SanitizeTimeValue(value, this.m_EaseInDuration));
    10.     }
    11. }
    12.  
    So my question is why have this seemingly arbitrary restriction?

    The only reason I can think of to do this is to stop the ease in and ease out from overlapping, but it's quite restrictive. In our use case we want an ease in for the full duration of the clip, but I can see other use cases where you might want the ease in to be 75% of the clip and the ease out to be 25%.

    If the concern about overlapping ease in/out, then why not clamp the ease into the start of the ease out.
     
    Carwashh likes this.
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Exactly that. It's to prevent overlap, and, yes, it is overly restrictive. We should change it, your suggestion is a good one!
     
    FracEdd likes this.
  3. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    762
    100% this, I've ran into this annoying restriction far too often.
     
  4. noio

    noio

    Joined:
    Dec 17, 2013
    Posts:
    231
    Haha what?

    I'm building custom tooling on top of the timeline where I'm using its neat GUI and WYSIWYG capabilities, and this had me stumped for a while. Could not figure out why I could not build a clip that ramps up and then ends (almost) immediately.
     
  5. sebastienlh

    sebastienlh

    Unity Technologies

    Joined:
    Sep 22, 2017
    Posts:
    40
    I agree with all of you that it is a bizarre and to be frank, quite annoying restriction. That's why we changed it! In Unity 19.3 and up, if you update Timeline to 1.3.0+ through the package manager, you can enjoy the sweet freedom of easing that you deserve!
     
    Carwashh and noio like this.