apply method

  1. @override
void apply(
  1. Duration t
)
override

Implementation

@override
void apply(Duration t) {
  clock.value = t;
  for (var entry in group.tracks.entries) {
    var track = entry.value;
    // A placement's blocks write the whole of what it plays: which clip,
    // where in it, and the second clip with its weight over an overlap.
    if (track.clips.isNotEmpty && entry.key == 'animationTime') {
      var b = track.blendAt(t);
      if (b.clip.isNotEmpty) node.writeFx(this, 'animation', b.clip);
      node.writeFx(this, 'animationTime', b.time);
      // The second clip only while there is one: a row written every
      // frame with its own default is a notification for nothing.
      if (b.clip2.isNotEmpty) {
        node.writeFx(this, 'animation2', b.clip2);
        node.writeFx(this, 'animationTime2', b.time2);
        node.writeFx(this, 'blend', b.blend);
      } else {
        node.removeFx(this, 'animation2');
        node.removeFx(this, 'animationTime2');
        node.removeFx(this, 'blend');
      }
      continue;
    }
    node.writeFx(this, entry.key, track.evaluate(t));
  }
}