read static method

ActorSkinnable read(
  1. ActorArtboard artboard,
  2. StreamReader reader,
  3. ActorSkinnable node
)

Implementation

static ActorSkinnable read(
    ActorArtboard artboard, StreamReader reader, ActorSkinnable node) {
  reader.openArray('bones');
  int numConnectedBones = reader.readUint8Length();
  if (numConnectedBones != 0) {
    node._connectedBones = <SkinnedBone>[];

    for (int i = 0; i < numConnectedBones; i++) {
      reader.openObject('bone');
      SkinnedBone bc = SkinnedBone(reader.readId('component'));
      Mat2D.copyFromList(bc.bind, reader.readFloat32Array(6, 'bind'));
      reader.closeObject();
      Mat2D.invert(bc.inverseBind, bc.bind);
      node._connectedBones!.add(bc);
    }
    reader.closeArray();
    Mat2D worldOverride = Mat2D();
    Mat2D.copyFromList(
        worldOverride, reader.readFloat32Array(6, 'worldTransform'));
    node.worldTransformOverride = worldOverride;
  } else {
    reader.closeArray();
  }

  return node;
}