Search Unity

Sub-animation frame rotation interpolation - is this a bug?

Discussion in 'Editor & General Support' started by Bezzy, Apr 15, 2015.

  1. Bezzy

    Bezzy

    Joined:
    Apr 1, 2009
    Posts:
    75
    Hi,
    We are working on a game with a very traditional, non digital animation style... intentionally low frame rates etc. No key-frame interpolation via curves. Any interpolation is done, essentially, by hand.

    We use a lot of "constant" keys, and a low sample rate (25fps as that is what our animator is used to).

    The constant keys work fine on the position property, snapping immediately to the correct positions, but clicking on a rotation key shows an erroneous rotation.

    It seems that although the keys are all set to "constant"*, there is still interpolation in the frame before the new constant rotation key. And it seems that, perhaps floating point error, causes the editor to sample just before the key, thus giving us the unintended interpolated rotation.

    So, if I have a rotation key at frame 0 with rotation = 0, and a rotation key at 5 set to 90, then the rotation will be 0 from frame 0 to 4, but between fame 4 and 5 it will (linearly?) interpolate to 90. We believe this shouldn't be so - that if the preceding key is set to constant, we only jump to 90 on or after 5.

    Clicking before or after the key on the time line shows us the rotation we set it to, but obviously, this is a total nightmare to edit with.

    I'm researching this problem, and am aware there are a lot of workarounds (use something other than transform.rotation and an accompanying script to force the values), but many of them will only work at run time, or automatically create undesired rotation keys when editing. This really hurts our iterative process.

    Does anyone have any experience of this? Should this be considered a bug? We're aware we're using this in quite a non traditional way. Should we be worried that fixing the constant rotation to work "as advertised" breaks other work flows?

    *Yes, I have tried all combinations of left/right/both for the keys. It's glitchy in all cases. I've also tried with quaternion vs. euler interpolation, and this seems to make no difference to this particular problem.
     
  2. Bezzy

    Bezzy

    Joined:
    Apr 1, 2009
    Posts:
    75
    Here is a gif which hopefully shows the issue.

    AnimationSubFrameInterpolation.gif

    Playing the animation only looks okay here because of the gif capture program's low frame rate. You can see the craziness of the foot rotation (amongst other rotations) when i click on the center key frame. And as you can see, all the keyframes in the entire animation are set to constant, on both sides.

    Also I should say that this is in unity 5. I've not seen if it's the same in earlier versions.
    Thanks for any help.
     
  3. Bezzy

    Bezzy

    Joined:
    Apr 1, 2009
    Posts:
    75