getBoneList function

List<Bone> getBoneList(
  1. dynamic object
)

Implementation

List<Bone> getBoneList(object) {
  List<Bone> boneList = [];

  if (object != null && object.type == "Bone") {
    boneList.add(object);
  }

  for (var i = 0; i < object.children.length; i++) {
    boneList.addAll(getBoneList(object.children[i]));
  }

  return boneList;
}