findBoneTrackData static method

dynamic findBoneTrackData(
  1. dynamic name,
  2. dynamic tracks
)

Implementation

static findBoneTrackData(name, tracks) {
  var regexp = RegExp(r"\[(.*)\]\.(.*)");

  var result = {"name": name};

  for (var i = 0; i < tracks.length; ++i) {
    // 1 is track name
    // 2 is track type
    var trackData = regexp.firstMatch(tracks[i].name);

    if (trackData != null && name == trackData.group(1)) {
      result[trackData.group(2)!] = i;
    }
  }

  return result;
}