Skip to content

KeyFrame transformations becoming corrupted #36

@TangoTek

Description

@TangoTek

Current Behavior

This occurs in all of the getNextXXX() or getPreviousXXX() functions inside ClientChannel.
getPreviousRotationKeyFrameForBox, getNextRotationKeyFrameForBox, etc

It seems "fake" KeyFrames are being cloned (possibly with negative positions) so that interpolation remains consistent. However, cloning a full keyframe which might contain multiple types of transformations (ie: rotation and translation) is incorrect since only the desired transformation type should be copied.

The "this.keyFrames.put" lines are potentially causing multiple issues.

  1. There might already be a keyframe at the new index being inserted that contains transformation data other than the type being searched for. This will cause all existing keyframe data in that index to be lost.
  2. Cloning a full KeyFrame structure is incorrect since it might contain transformations other than the type being searched for.

Possible Solution

Don't clone the entire KeyFrame with potentially all 4 types of transformations. Instead create a new KeyFrame and only copy over the relevant translation, rotation, offset, or stretch data.

Also, be careful not to stomp existing KeyFrame data in the keyFrames map by using a put() on an index that already exists. This can happen in the existing code which causes data to be lost.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions