FBXLoader: Use first existing frame of animation instead of initial value (Proposal)

Hello.

I’m encountered issue when some animated FBX rigs doesn’t have keyframes for specific channel of animation.

example: Hips.position.x and Hips.position.z have keyframe at 0 second, but Hips.position.y not. AnimationParser set value of 0 for this channel and it cause animation jump on start. It also can happen with rotations. In that case you can see character’s hand in rest pose.

I did research how other DCCs (blender, houdini) handle this situation and discover that absent keyframes just replaced with values from first existed keyframe.

Basic solution:

// class AnimationParser

// ...

getInitialValue(curves, initialValue) {
    return [
      curves.x.values[0] || initialValue[0],
      curves.y.values[0] || initialValue[1],
      curves.z.values[0] || initialValue[2],
    ];
  }

// ...

getKeyframeTrackValues(times, curves, initialValue) {
    const prevValue = this.getInitialValue(curves, initialValue);

//...

May it will be coherent to use same approach for non-existent keyframes?
What do community think about this?