parse static method

dynamic parse(
  1. dynamic json
)

Implementation

static parse(json) {
  var tracks = <KeyframeTrack>[];

  var jsonTracks = json.tracks, frameTime = 1.0 / (json.fps ?? 1.0);

  for (var i = 0, n = jsonTracks.length; i != n; ++i) {
    tracks.add(parseKeyframeTrack(jsonTracks[i]).scale(frameTime));
  }

  var clip = AnimationClip(json.name, json.duration, tracks, json.blendMode);
  clip.uuid = json.uuid;

  return clip;
}