{
  "$id": "https://ara3dgen.com/schemas/pack-source.v1.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Ara pack source (pack.json)",
  "description": "The animation files of a pack and how to use them. ara3d pack new writes one; ara3d pack build reads it.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "name",
    "animations"
  ],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "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": [
          "file"
        ],
        "properties": {
          "file": {
            "type": "string",
            "pattern": "\\.(fbx|glb|gltf|bvh)$",
            "description": "The file, next to pack.json: FBX (Mixamo and most tools), glTF/GLB or BVH."
          },
          "clip": {
            "type": "string",
            "description": "Which animation in the file, by name (default: the first)."
          },
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_]{0,47}$",
            "description": "Default: from the file name."
          },
          "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."
          },
          "loop": {
            "type": "boolean",
            "description": "Default: when its last pose matches its first."
          },
          "start": {
            "type": "number",
            "minimum": 0,
            "description": "Seconds into the recording to start."
          },
          "end": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Seconds into the recording to end."
          },
          "fps": {
            "type": "integer",
            "minimum": 24,
            "maximum": 60,
            "description": "Frames a second to keep (default: the file's own rate)."
          },
          "hands": {
            "const": "fist",
            "description": "Closed fists when the recording has no fingers."
          },
          "ground": {
            "type": "boolean",
            "description": "Keep the lowest foot on the floor every frame (seated and lying clips)."
          },
          "mirror": {
            "type": "boolean",
            "description": "BVH only: mirrored left to right."
          },
          "armSpread": {
            "type": "number",
            "minimum": -20,
            "maximum": 20,
            "description": "Degrees to turn the arms out from the body."
          },
          "legSpread": {
            "type": "number",
            "minimum": -10,
            "maximum": 15,
            "description": "Degrees to turn the legs out (default 0; 4 for CMU recordings)."
          },
          "bones": {
            "type": "object",
            "additionalProperties": {
              "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"
              ]
            },
            "description": "Source joint name -> Ara (Mixamo) bone name, for skeletons Ara doesn't recognise."
          }
        }
      }
    }
  }
}
