{
  "$id": "https://ara3dgen.com/schemas/pack.v1.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Ara content pack, version 1",
  "description": "Written by ara3d pack build. Holds data only; every app checks it before use.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "kind",
    "version",
    "id",
    "name",
    "animations"
  ],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "kind": {
      "const": "ara-pack"
    },
    "version": {
      "const": 1
    },
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{1,39}$",
      "description": "The pack's ID: its animations are named \"<id>/<animation>\"."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
    },
    "author": {
      "type": "string",
      "maxLength": 100
    },
    "license": {
      "type": "string",
      "maxLength": 60,
      "description": "An SPDX licence ID (such as CC-BY-4.0) or a short licence name."
    },
    "homepage": {
      "type": "string",
      "maxLength": 500,
      "pattern": "^https?://"
    },
    "description": {
      "type": "string",
      "maxLength": 500
    },
    "animations": {
      "type": "array",
      "minItems": 1,
      "maxItems": 400,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "category",
          "motion"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_]{0,47}$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "category": {
            "enum": [
              "Idle & stance",
              "Locomotion",
              "Turns",
              "Actions",
              "Emotes",
              "Reactions",
              "Sitting & lying",
              "Interaction",
              "Everyday",
              "Combat",
              "Sports",
              "Fitness"
            ],
            "description": "The group the animation joins in Ara."
          },
          "motion": {
            "type": "object",
            "description": "Retargeted motion: per frame, each bone's rotation (int16 quaternions) and the hips position, base64.",
            "required": [
              "duration",
              "loop",
              "frames",
              "bones",
              "rot",
              "hips",
              "dir",
              "bias"
            ],
            "properties": {
              "duration": {
                "type": "number",
                "exclusiveMinimum": 0,
                "maximum": 120
              },
              "loop": {
                "type": "boolean"
              },
              "travel": {
                "type": "array",
                "minItems": 3,
                "maxItems": 3,
                "items": {
                  "type": "number"
                }
              },
              "frames": {
                "type": "integer",
                "minimum": 2
              },
              "bones": {
                "type": "array",
                "items": {
                  "enum": [
                    "Hips",
                    "Spine",
                    "Spine1",
                    "Spine2",
                    "Neck",
                    "Head",
                    "LeftShoulder",
                    "LeftArm",
                    "LeftForeArm",
                    "LeftHand",
                    "LeftUpLeg",
                    "LeftLeg",
                    "LeftFoot",
                    "LeftHandThumb1",
                    "LeftHandThumb2",
                    "LeftHandThumb3",
                    "LeftHandIndex1",
                    "LeftHandIndex2",
                    "LeftHandIndex3",
                    "LeftHandMiddle1",
                    "LeftHandMiddle2",
                    "LeftHandMiddle3",
                    "LeftHandRing1",
                    "LeftHandRing2",
                    "LeftHandRing3",
                    "LeftHandPinky1",
                    "LeftHandPinky2",
                    "LeftHandPinky3",
                    "RightShoulder",
                    "RightArm",
                    "RightForeArm",
                    "RightHand",
                    "RightUpLeg",
                    "RightLeg",
                    "RightFoot",
                    "RightHandThumb1",
                    "RightHandThumb2",
                    "RightHandThumb3",
                    "RightHandIndex1",
                    "RightHandIndex2",
                    "RightHandIndex3",
                    "RightHandMiddle1",
                    "RightHandMiddle2",
                    "RightHandMiddle3",
                    "RightHandRing1",
                    "RightHandRing2",
                    "RightHandRing3",
                    "RightHandPinky1",
                    "RightHandPinky2",
                    "RightHandPinky3"
                  ]
                },
                "uniqueItems": true
              },
              "rot": {
                "type": "string",
                "contentEncoding": "base64"
              },
              "hips": {
                "type": "string",
                "contentEncoding": "base64"
              },
              "dir": {
                "type": "object",
                "propertyNames": {
                  "enum": [
                    "Hips",
                    "Spine",
                    "Spine1",
                    "Spine2",
                    "Neck",
                    "Head",
                    "LeftShoulder",
                    "LeftArm",
                    "LeftForeArm",
                    "LeftHand",
                    "LeftUpLeg",
                    "LeftLeg",
                    "LeftFoot",
                    "LeftHandThumb1",
                    "LeftHandThumb2",
                    "LeftHandThumb3",
                    "LeftHandIndex1",
                    "LeftHandIndex2",
                    "LeftHandIndex3",
                    "LeftHandMiddle1",
                    "LeftHandMiddle2",
                    "LeftHandMiddle3",
                    "LeftHandRing1",
                    "LeftHandRing2",
                    "LeftHandRing3",
                    "LeftHandPinky1",
                    "LeftHandPinky2",
                    "LeftHandPinky3",
                    "RightShoulder",
                    "RightArm",
                    "RightForeArm",
                    "RightHand",
                    "RightUpLeg",
                    "RightLeg",
                    "RightFoot",
                    "RightHandThumb1",
                    "RightHandThumb2",
                    "RightHandThumb3",
                    "RightHandIndex1",
                    "RightHandIndex2",
                    "RightHandIndex3",
                    "RightHandMiddle1",
                    "RightHandMiddle2",
                    "RightHandMiddle3",
                    "RightHandRing1",
                    "RightHandRing2",
                    "RightHandRing3",
                    "RightHandPinky1",
                    "RightHandPinky2",
                    "RightHandPinky3"
                  ]
                },
                "additionalProperties": {
                  "type": "array",
                  "minItems": 3,
                  "maxItems": 3,
                  "items": {
                    "type": "number"
                  }
                }
              },
              "bias": {
                "type": "object",
                "propertyNames": {
                  "enum": [
                    "Hips",
                    "Spine",
                    "Spine1",
                    "Spine2",
                    "Neck",
                    "Head",
                    "LeftShoulder",
                    "LeftArm",
                    "LeftForeArm",
                    "LeftHand",
                    "LeftUpLeg",
                    "LeftLeg",
                    "LeftFoot",
                    "LeftHandThumb1",
                    "LeftHandThumb2",
                    "LeftHandThumb3",
                    "LeftHandIndex1",
                    "LeftHandIndex2",
                    "LeftHandIndex3",
                    "LeftHandMiddle1",
                    "LeftHandMiddle2",
                    "LeftHandMiddle3",
                    "LeftHandRing1",
                    "LeftHandRing2",
                    "LeftHandRing3",
                    "LeftHandPinky1",
                    "LeftHandPinky2",
                    "LeftHandPinky3",
                    "RightShoulder",
                    "RightArm",
                    "RightForeArm",
                    "RightHand",
                    "RightUpLeg",
                    "RightLeg",
                    "RightFoot",
                    "RightHandThumb1",
                    "RightHandThumb2",
                    "RightHandThumb3",
                    "RightHandIndex1",
                    "RightHandIndex2",
                    "RightHandIndex3",
                    "RightHandMiddle1",
                    "RightHandMiddle2",
                    "RightHandMiddle3",
                    "RightHandRing1",
                    "RightHandRing2",
                    "RightHandRing3",
                    "RightHandPinky1",
                    "RightHandPinky2",
                    "RightHandPinky3"
                  ]
                },
                "additionalProperties": {
                  "type": "array",
                  "minItems": 4,
                  "maxItems": 4,
                  "items": {
                    "type": "number"
                  }
                }
              },
              "hands": {
                "const": "fist"
              },
              "ground": {
                "type": "boolean"
              },
              "anchor": {
                "type": "object",
                "required": [
                  "rot",
                  "hips",
                  "key"
                ],
                "properties": {
                  "rot": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  },
                  "hips": {
                    "type": "array",
                    "minItems": 3,
                    "maxItems": 3,
                    "items": {
                      "type": "number"
                    }
                  },
                  "key": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
