Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Imported animation start/end frame confusion

Discussion in 'Animation' started by ArachnidAnimal, Apr 17, 2017.

  1. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,727
    I have an imported model from Blender. I'm not sure about what the start/end frames should be.

    In the model I've keyframed animations that go from 0 to 60. When I import the file into Unity, Unity attempts to make the start frame be -1 and the end frame be 59.

    If I change this to 0 and 60, the animation stalls a couple of frames and doesn't loop seamlessly.
    Is the start and end frame for the Animation clips supposed to be one less than what is in the imported model?
     
  2. TrickyHandz

    TrickyHandz

    Joined:
    Jul 23, 2010
    Posts:
    196
  3. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,727
    IF it is a bug, I don't see how Unity would be able to fix it without altering everyone's existing animation clip information.

    This has occurred for a couple of years, where Unity creates a "Default Take" clip which always ranged from -1 to X, when importing Blender animations.
    After more testing, it seems the start and end frames of the animation clip must be 1 less than the positions in the keyframes in the Blender file. So if the keyframes are at 0 to 10, the animation clip must be created going from -1 to 9. Changing this to 0 to 10 results in anomolies during animations.
    I looked at the model closely and noticed it was "Jittering" or shaking when looping. This is because the animation playing was actually going past the end point and approaching the next keyframe in the model.
     
  4. DavidGeoffroy

    DavidGeoffroy

    Unity Technologies

    Joined:
    Sep 9, 2014
    Posts:
    542
    Once a file is imported, the frame range is saved in the meta file.

    The fix would only apply to new files, so my gut tells me we should be able to fix it without breaking backwards compatibility
     
    TrickyHandz and ArachnidAnimal like this.