Search Unity

Adjacent keyframes contain "hiccups" (imported FBX file from 3ds Max)

Discussion in 'Animation' started by TheCatProblem, Sep 5, 2013.

  1. TheCatProblem

    TheCatProblem

    Joined:
    May 26, 2011
    Posts:
    22
    I made a model in 3ds Max containing some simple animation. Basically, I've got an object and the animation consists of it rotating about its pivot point.

    There are keyframes on frames 0, 3, 4, and 24. Frames 0 and 3 are identical. 4 is substantially different from 0 and 3 (i.e., the object is rotated quite a bit), while 24 is closer to 0 and 3 but still slightly different.

    I've exported the model as an FBX and imported it into Unity. The rig is set to "legacy" and I've split the animation into clips as follows:
    Idle: frames 0-3 (loop) - note that, as keyframes 0 and 3 are identical, this clip should entail no actual movement
    Move: frames 4-24 (ping pong) - this is just an animation of the object rotating back and forth between its positions on keyframes 4 and 24

    I should also note that keyframe compression is turned off.

    The problem I'm having is that both animation clips contain a small "hiccup" (a random jerky movement that's not in the original animation as viewed in 3ds Max).

    In the idle clip, this hiccup occurs on frame 3 and makes the object appear to "flutter" rather than remain still if the idle animation is looped. If the idle clip is redefined as frames 0-2, no movement occurs (as intended).

    In the movement clip, the hiccup is on frame 4 (if this frame is removed from the clip, the animation is smooth, although the object doesn't rotate quite as much).

    Has anyone experienced this problem before? I can post an example file if that would help.

    Any suggestions would be appreciated!
     
    Last edited: Sep 5, 2013
    XCO likes this.
  2. vinfang

    vinfang

    Joined:
    Jul 13, 2013
    Posts:
    14
    Not sure if this would help but have you tried to create a simple cube or sphere object with a texture object and have it automatically rotate? Does it contain any animation jittering as well? What version of Unity are you using?

    In my other thread, I've have a sphere that rotates with a texture object and while there are no frames it seems to jitter periodically or randomly. I can't tell if it's the scene preview that's the problem or something else. Unfortunately I've had no response so the only thing is to maybe confirm it's just the preview and not your model.
     
  3. TheCatProblem

    TheCatProblem

    Joined:
    May 26, 2011
    Posts:
    22
    The object in question is actually pretty simple: it's just a 3ds Max capsule with its pivot point moved to one end. It's already UV mapped and textured, too (although I don't think that affects the animation). I'm using Unity 4.2.

    I took a look at your other thread; I suspect your issue may be unrelated to mine since you're creating your animations in Unity (rather than importing them).
     
  4. TheCatProblem

    TheCatProblem

    Joined:
    May 26, 2011
    Posts:
    22
    I've had time to perform some tests and it seems that this problem only occurs when keyframes are adjacent. For example, the following configuration does not result in the jittering problem once exported as an FBX and imported into Unity.

    Code (csharp):
    1.  
    2. // State is the state of the object being animated
    3. State: 1  1  1|2  2          3
    4. Frame: 0--3--6|7--10---------20
    5.  
    (where frames [0,3] comprise the first animation and frames [10,20] contain the second)

    The buffer between the two animations created by placing unused duplicates of frames 3 and 10 (namely, frames 6 and 7) adjacent to each other removes the "hiccups" observed when the animation is laid out as follows:

    Code (csharp):
    1.  
    2. State: 1  1|2         3
    3. Frame: 0--3|4---------14
    4.  
    (where frames [0,3] and [4,14] comprise the first and second animations; note that I changed the range from my original post for the sake of this example)

    If I had to guess at the underlying problem, I'd say that Unity's FBX importer is somehow blending adjacent keyframes. However, this doesn't explain why (in the jittering case) frame 3 would blend forward into frame 4 but frame 4 would blend backward into frame 3 (if frame 4 blended into frame 5, it would be slightly inaccurate relative to the original animation but the hiccup wouldn't be noticeable since frames 4 and 5 are part of the same simple animation), so perhaps this theory is incorrect.

    In any case, if anyone else can replicate this behaviour, please let me know (I can post a sample FBX file that exhibits this problem if that would help).
     
    XCO likes this.
  5. cosmoray

    cosmoray

    Joined:
    Jan 25, 2014
    Posts:
    2
    Did you ever find a solution for this? I'm having a very similar problem. Regardless of whether I get rid of or reinterpret the excess keyframes, I still get a ping-ponging effect around the keys.

    This is a cube that rotates ( http://i.imgur.com/6VyQBL0.gifv ) in stepped frames, and another that changes x-position in stepped frames. The position cube is correct, but the rotation one still ping pongs on the keys.

    These are the keys for the animation clip.