Search Unity

Manually editing keyframes from clips a mess?

Discussion in 'Timeline' started by AcidArrow, Jan 9, 2020.

  1. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,799
    Is there a weird 1 frame offset between what you're seeing and what you're editing, or am I seeing things?

    Here I am trying to edit the first keyframe of the second clip in a timeline.

    The first time I'm trying from Timeline itself, then I undo and I try to edit from the animation window.

    Both times the last keyframe of the previous clip gets edited instead, even though in the scene view I am correctly viewing the first frame of the clip I actually want to edit.

    Can I do something to combat this? It's almost impossible to work like this.

     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    That looks like a bug. It is targeting the wrong clip. The workaround is to insert a small gap between the clips while recording so it lets you target the first frame.

    I'd recommend filing a bug (for your own tracking), but I'll also pass it along to the QA team, since it is a fairly simple repo.
     
    AcidArrow likes this.
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,799
    That is slightly unexpected. I also saw this issue years ago, but I thought I was doing something wrong, and I sort of still do?

    Am I using Timeline in weird ways?

    I like having a bunch of recorded clips with cuts to animate cameras for cutscenes and obviously the first and last keyframes of a recorded clip are super important to edit all the time. When trying to do this in Timeline (not only because of this bug, other smaller and bigger issues, like recorded clips getting corrupted with collaborate), Timeline constantly makes me feel that I'm doing it wrong and I'm fighting against it.
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,799
    It's not that it's targeting the wrong clip per se. There is a one frame offset thing going on.

    If I move an object from the inspector (with the appropriate track in Timeline in record mode) the keyframe generated is one frame back.

    keyframe.png

    If I click the Add keyframe button on the animation window it is added correctly.
     
  5. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    No, but in my experience most users don't record with multiple clips, probably because the 'infinite clip' mode is the default mode. When workflow problems do arise, they are almost always caught in that mode.

    I did sent this bug off to QA.

    But recording the last key is...hmm...well weird... The reason is the way timeline evaluates clips - It is exclusive on the last key.

    So a timeline clip that goes from [0->5], doesn't evaluate the clip if the time if 5 exactly. But because animation clips extrapolate by default, it will, except when two clips are adjacent ([0->5][5->10]). In that case the first key frame of the second clip is evaluated.

    This is by design, so that on aligned clips, the second clip and not the first clip is evaluated when the time is exactly at t = 5.

    For playback, that works quite well, because in practice it is rare t is ever exactly 5. If it is, it is always the second clip that evaluates.

    However, it makes it difficult to edit the last keyframe in timeline when there are adjacent clips, and it's definitely a bug that it is trying to, or at least that it indicates the wrong clip. That is something we definitely should have caught.

    And because we use animation clips, which require keys on frames, it is likely what is causing the one frame offset.
     
    AcidArrow likes this.