Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Update method for being frame perfect - unsolicited keyframe interpolation

Discussion in 'Timeline' started by g4ma, Jun 27, 2023.

  1. g4ma


    Dec 18, 2018
    Hello, I am wondering about how time gets managed in playable directors with regards to animations.
    It looks as if we had unsolicited keyframe interpolation or that time management "skips" an animation keyframe even though we do everything we can to have a frame perfect animation.

    The context is important as we are an animation studio - our films and series are fully rendered within Unity.
    We edit our animations in a DCC e.g. Blender, export it using a custom format and create animation clips based on it using custom importers.

    What is crucial is for animations to be frame perfect: they must match the ones in Blender exactly at every frame of any given sequence.

    This implies a number of things on the way we author things:
    - our animations have keyframe interpolation disabled (all tangents set to "constant")
    - our animations are baked ie one keyframe at every frame
    - the animation is authored at 25fps, the timeline is set at 25 fps and we capture at that exact framerate.

    So with all that I was expecting to get the exact same result out of Unity that what got in from Blender.

    However, in certain shots, we have that "missed keyframe", usually for one animated object at the time only, happening from time to time: sometimes once, sometimes 2 to 5 times in a 10s-long sequence. It is deterministic: rendering twice in a row, even after tweaking some rendering options, will get us the same issue.
    It happens especially on a certain travelling for a wide shot. It looks like the camera animation skips e.g. frame 8, frame 15...Yet the transform animation is very clearly linear albeit stepped - you can see the attached screenshot.

    It looks as if the actual game time fell just short of hitting the actual keyframe.

    It seems to happen more often on "heavy" scenes (our scenes have 10k objects).
    It only happens in play mode and we were not able to see it if previewing the timeline in the editor.

    What could happen here?
    I guess what we want is having the game time to "snap" to every 1/25th + epsilon so we make sure the right keyframes are taken into account?
    Our playable director update method is "game time", would it be advised to switch it to something else?

    Attached Files: