{
  "$defs": {
    "AngleKey": {
      "additionalProperties": false,
      "properties": {
        "curve": {
          "$ref": "#/$defs/Curve",
          "description": "How the value goes from this key to the next one."
        },
        "time": {
          "description": "In seconds from the start of the animation.",
          "format": "float",
          "type": "number"
        },
        "value": {
          "description": "In degrees.",
          "format": "float",
          "type": "number"
        }
      },
      "required": [
        "time",
        "value"
      ],
      "type": "object"
    },
    "Animation": {
      "additionalProperties": false,
      "properties": {
        "bones": {
          "description": "The bones that move, each one once.",
          "items": {
            "$ref": "#/$defs/BoneTimelines"
          },
          "type": "array"
        },
        "duration": {
          "description": "In seconds, above 0. No key comes after it.",
          "format": "float",
          "type": "number"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "duration"
      ],
      "type": "object"
    },
    "Attachment": {
      "oneOf": [
        {
          "additionalProperties": false,
          "properties": {
            "region": {
              "$ref": "#/$defs/Region"
            }
          },
          "required": [
            "region"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "Since 0.2.",
          "properties": {
            "mesh": {
              "$ref": "#/$defs/Mesh"
            }
          },
          "required": [
            "mesh"
          ],
          "type": "object"
        }
      ]
    },
    "Bone": {
      "additionalProperties": false,
      "properties": {
        "inherit": {
          "$ref": "#/$defs/Inherit"
        },
        "length": {
          "description": "How long the bone is drawn along its x axis.",
          "format": "float",
          "type": "number"
        },
        "name": {
          "description": "The name of the bone, the only one of that name in the file.",
          "type": "string"
        },
        "parent": {
          "description": "The name of the parent, which is written before this bone. A bone with no parent is a root.",
          "type": [
            "string",
            "null"
          ]
        },
        "rotation": {
          "description": "In degrees, counter-clockwise.",
          "format": "float",
          "type": "number"
        },
        "scale_x": {
          "format": "float",
          "type": "number"
        },
        "scale_y": {
          "format": "float",
          "type": "number"
        },
        "shear_x": {
          "description": "In degrees: leans the y axis towards the x axis.",
          "format": "float",
          "type": "number"
        },
        "shear_y": {
          "description": "In degrees: leans the x axis towards the y axis.",
          "format": "float",
          "type": "number"
        },
        "x": {
          "description": "The position in the space of the parent.",
          "format": "float",
          "type": "number"
        },
        "y": {
          "format": "float",
          "type": "number"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "BoneTimelines": {
      "additionalProperties": false,
      "description": "The keys of one bone. Each list is in the order of time; values are relative to the setup\npose.",
      "properties": {
        "bone": {
          "description": "The name of the bone.",
          "type": "string"
        },
        "rotation": {
          "description": "Degrees added to the rotation of the bone.",
          "items": {
            "$ref": "#/$defs/AngleKey"
          },
          "type": "array"
        },
        "scale": {
          "description": "Multiplies the scale of the bone.",
          "items": {
            "$ref": "#/$defs/PointKey"
          },
          "type": "array"
        },
        "shear": {
          "description": "Degrees added to the shear of the bone.",
          "items": {
            "$ref": "#/$defs/PointKey"
          },
          "type": "array"
        },
        "translation": {
          "description": "Added to the position of the bone.",
          "items": {
            "$ref": "#/$defs/PointKey"
          },
          "type": "array"
        }
      },
      "required": [
        "bone"
      ],
      "type": "object"
    },
    "Curve": {
      "oneOf": [
        {
          "const": "linear",
          "description": "At a constant speed.",
          "type": "string"
        },
        {
          "const": "stepped",
          "description": "The value holds until the next key, then jumps.",
          "type": "string"
        },
        {
          "additionalProperties": false,
          "description": "A cubic Bézier curve from (0, 0) to (1, 1), given by its two control points as\n`[x1, y1, x2, y2]`, with x1 and x2 from 0 to 1.",
          "properties": {
            "bezier": {
              "items": {
                "format": "float",
                "type": "number"
              },
              "maxItems": 4,
              "minItems": 4,
              "type": "array"
            }
          },
          "required": [
            "bezier"
          ],
          "type": "object"
        }
      ]
    },
    "FormatVersion": {
      "description": "The versions of the format this code reads and writes.",
      "oneOf": [
        {
          "const": "0.1",
          "description": "Bones, slots, region attachments, skins, animations of bones.",
          "type": "string"
        },
        {
          "const": "0.2",
          "description": "0.1, and mesh attachments.",
          "type": "string"
        }
      ]
    },
    "Inherit": {
      "description": "What a bone takes from its parent.",
      "oneOf": [
        {
          "const": "full",
          "description": "The axes follow the parent entirely.",
          "type": "string"
        },
        {
          "const": "translation_only",
          "description": "Only the position follows the parent.",
          "type": "string"
        },
        {
          "const": "no_rotation",
          "description": "The axes follow the scale and the shear of the parent, not its rotation.",
          "type": "string"
        },
        {
          "const": "no_scale",
          "description": "The axes follow the rotation and the shear of the parent, not its scale.",
          "type": "string"
        }
      ]
    },
    "Mesh": {
      "additionalProperties": false,
      "description": "An image cut into triangles whose corners follow bones.",
      "properties": {
        "path": {
          "description": "Where the image is, relative to the file.",
          "type": "string"
        },
        "triangles": {
          "description": "Three places in `vertices` for each triangle, the first vertex being 0.",
          "items": {
            "items": {
              "format": "uint32",
              "minimum": 0,
              "type": "integer"
            },
            "maxItems": 3,
            "minItems": 3,
            "type": "array"
          },
          "type": "array"
        },
        "vertices": {
          "items": {
            "$ref": "#/$defs/Vertex"
          },
          "type": "array"
        }
      },
      "required": [
        "path",
        "vertices",
        "triangles"
      ],
      "type": "object"
    },
    "PointKey": {
      "additionalProperties": false,
      "properties": {
        "curve": {
          "$ref": "#/$defs/Curve",
          "description": "How the value goes from this key to the next one."
        },
        "time": {
          "description": "In seconds from the start of the animation.",
          "format": "float",
          "type": "number"
        },
        "x": {
          "format": "float",
          "type": "number"
        },
        "y": {
          "format": "float",
          "type": "number"
        }
      },
      "required": [
        "time",
        "x",
        "y"
      ],
      "type": "object"
    },
    "Region": {
      "additionalProperties": false,
      "description": "A rectangular image, placed in the space of the bone of its slot.",
      "properties": {
        "height": {
          "format": "float",
          "type": "number"
        },
        "path": {
          "description": "Where the image is, relative to the file.",
          "type": "string"
        },
        "rotation": {
          "format": "float",
          "type": "number"
        },
        "scale_x": {
          "format": "float",
          "type": "number"
        },
        "scale_y": {
          "format": "float",
          "type": "number"
        },
        "shear_x": {
          "format": "float",
          "type": "number"
        },
        "shear_y": {
          "format": "float",
          "type": "number"
        },
        "width": {
          "format": "float",
          "type": "number"
        },
        "x": {
          "description": "The position of the centre of the image.",
          "format": "float",
          "type": "number"
        },
        "y": {
          "format": "float",
          "type": "number"
        }
      },
      "required": [
        "path",
        "width",
        "height"
      ],
      "type": "object"
    },
    "Skin": {
      "additionalProperties": false,
      "properties": {
        "attachments": {
          "items": {
            "$ref": "#/$defs/SkinAttachment"
          },
          "type": "array"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "attachments"
      ],
      "type": "object"
    },
    "SkinAttachment": {
      "additionalProperties": false,
      "properties": {
        "attachment": {
          "$ref": "#/$defs/Attachment"
        },
        "name": {
          "description": "The name of the attachment in that slot.",
          "type": "string"
        },
        "slot": {
          "description": "The name of the slot the attachment can be shown in.",
          "type": "string"
        }
      },
      "required": [
        "slot",
        "name",
        "attachment"
      ],
      "type": "object"
    },
    "Slot": {
      "additionalProperties": false,
      "properties": {
        "attachment": {
          "description": "The name of the attachment shown in the setup pose.",
          "type": [
            "string",
            "null"
          ]
        },
        "bone": {
          "description": "The name of the bone the slot is on.",
          "type": "string"
        },
        "color": {
          "description": "Red, green, blue and alpha, each from 0 to 1, not premultiplied.",
          "items": {
            "format": "float",
            "type": "number"
          },
          "maxItems": 4,
          "minItems": 4,
          "type": "array"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "bone"
      ],
      "type": "object"
    },
    "Vertex": {
      "additionalProperties": false,
      "properties": {
        "u": {
          "description": "Where the vertex is on the image, from 0 to 1 from its left to its right.",
          "format": "float",
          "type": "number"
        },
        "v": {
          "description": "From 0 to 1 from the top of the image to its bottom.",
          "format": "float",
          "type": "number"
        },
        "weights": {
          "description": "The bones that carry the vertex. Their weights add up to 1.",
          "items": {
            "$ref": "#/$defs/Weight"
          },
          "type": "array"
        }
      },
      "required": [
        "u",
        "v",
        "weights"
      ],
      "type": "object"
    },
    "Weight": {
      "additionalProperties": false,
      "properties": {
        "bone": {
          "description": "The name of the bone.",
          "type": "string"
        },
        "weight": {
          "description": "The share of that bone in the place of the vertex, from 0 to 1.",
          "format": "float",
          "type": "number"
        },
        "x": {
          "description": "Where the vertex is in the space of that bone, in the setup pose.",
          "format": "float",
          "type": "number"
        },
        "y": {
          "format": "float",
          "type": "number"
        }
      },
      "required": [
        "bone",
        "x",
        "y"
      ],
      "type": "object"
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "A pantin file: one skeleton and its animations.",
  "properties": {
    "animations": {
      "items": {
        "$ref": "#/$defs/Animation"
      },
      "type": "array"
    },
    "bones": {
      "description": "The bones, each parent before its children.",
      "items": {
        "$ref": "#/$defs/Bone"
      },
      "type": "array"
    },
    "format_version": {
      "$ref": "#/$defs/FormatVersion",
      "description": "The version of the format the file is written in."
    },
    "name": {
      "description": "The name of the skeleton.",
      "type": "string"
    },
    "skins": {
      "items": {
        "$ref": "#/$defs/Skin"
      },
      "type": "array"
    },
    "slots": {
      "description": "The slots, in the order they are drawn: the first one is behind the others.",
      "items": {
        "$ref": "#/$defs/Slot"
      },
      "type": "array"
    }
  },
  "required": [
    "format_version",
    "name",
    "bones"
  ],
  "title": "pantin file, format 0.2",
  "type": "object"
}
