resetDuration method

AnimationClip resetDuration()

Sets the duration of the clip to the duration of its longest KeyframeTrack.

Implementation

AnimationClip resetDuration() {
  final tracks = this.tracks;
  num duration = 0;

  for (int i = 0, n = tracks.length; i != n; ++i) {
    final track = this.tracks[i];
    duration = math.max(duration, track.times.last);
  }

  this.duration = duration;

  return this;
}