{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:animsmith:schema:conversion-evidence:2",
  "title": "animsmith conversion evidence v2",
  "description": "Machine-readable evidence emitted by animsmith convert --format json.",
  "type": "object",
  "required": ["schema_version", "schema", "tool", "command", "input", "output", "options", "artifact"],
  "properties": {
    "schema_version": { "const": 2 }, "schema": { "const": "urn:animsmith:schema:conversion-evidence:2" },
    "tool": { "$ref": "#/$defs/tool" }, "command": { "const": "convert" },
    "input": { "type": "string" }, "output": { "type": "string" },
    "options": { "$ref": "#/$defs/options" }, "artifact": { "$ref": "#/$defs/artifact" },
    "static_mesh_bake": { "$ref": "#/$defs/static_mesh_bake" },
    "material_texture_recipe": { "$ref": "#/$defs/material_texture_recipe" }
  },
  "allOf": [
    { "if": { "properties": { "options": { "properties": { "bake_static_mesh_transforms": { "const": true } }, "required": ["bake_static_mesh_transforms"] } }, "required": ["options"] }, "then": { "required": ["static_mesh_bake"] }, "else": { "not": { "required": ["static_mesh_bake"] } } },
    { "if": { "properties": { "options": { "properties": { "material_texture_recipe": { "type": "string" } }, "required": ["material_texture_recipe"] } }, "required": ["options"] }, "then": { "required": ["material_texture_recipe"] }, "else": { "not": { "required": ["material_texture_recipe"] } } }
  ],
  "additionalProperties": false,
  "$defs": {
    "tool": { "type": "object", "required": ["name", "version", "source"], "properties": { "name": { "const": "animsmith" }, "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$" }, "source": { "type": "object", "required": ["revision", "dirty"], "properties": { "revision": { "type": ["string", "null"], "pattern": "^[0-9a-fA-F]{40}$" }, "dirty": { "type": ["boolean", "null"] } }, "additionalProperties": false } }, "additionalProperties": false },
    "options": { "type": "object", "required": ["animation_only", "bake_static_mesh_transforms", "material_texture_recipe"], "properties": { "animation_only": { "type": "boolean" }, "bake_static_mesh_transforms": { "type": "boolean" }, "material_texture_recipe": { "type": ["string", "null"] } }, "not": { "anyOf": [ { "properties": { "animation_only": { "const": true }, "bake_static_mesh_transforms": { "const": true } } }, { "properties": { "animation_only": { "const": true }, "material_texture_recipe": { "type": "string" } } } ] }, "additionalProperties": false },
    "artifact": { "type": "object", "required": ["nodes", "animations", "meshes", "primitive_positions", "materials", "clips_without_writable_tracks"], "properties": { "nodes": { "type": "integer", "minimum": 0 }, "animations": { "type": "integer", "minimum": 0 }, "meshes": { "type": "integer", "minimum": 0 }, "primitive_positions": { "type": "integer", "minimum": 0 }, "materials": { "type": "integer", "minimum": 0 }, "clips_without_writable_tracks": { "type": "integer", "minimum": 0 } }, "additionalProperties": false },
    "static_mesh_bake": { "type": "object", "required": ["entries"], "properties": { "entries": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/static_mesh_bake_entry" } } }, "additionalProperties": false },
    "static_mesh_bake_entry": { "type": "object", "required": ["source_node_index", "source_node_name", "source_mesh_ordinal", "source_mesh_index", "source_mesh_name", "output_node_index", "output_mesh_index", "world_transform", "linear_determinant", "primitive_count", "position_count", "normal_count"], "properties": { "source_node_index": { "type": "integer", "minimum": 0 }, "source_node_name": { "type": "string" }, "source_mesh_ordinal": { "type": "integer", "minimum": 0 }, "source_mesh_index": { "type": "integer", "minimum": 0 }, "source_mesh_name": { "type": "string" }, "output_node_index": { "type": "integer", "minimum": 0 }, "output_mesh_index": { "type": "integer", "minimum": 0 }, "world_transform": { "type": "array", "items": { "type": "number" }, "minItems": 16, "maxItems": 16 }, "linear_determinant": { "type": "number" }, "primitive_count": { "type": "integer", "minimum": 0 }, "position_count": { "type": "integer", "minimum": 0 }, "normal_count": { "type": "integer", "minimum": 0 } }, "additionalProperties": false },
    "material_texture_recipe": { "type": "object", "required": ["schema_version", "schema", "path", "texture_root", "max_dimension", "processor", "consumed_inputs", "emitted_textures"], "properties": { "schema_version": { "const": 1 }, "schema": { "const": "urn:animsmith:schema:material-texture-recipe:1" }, "path": { "type": "string" }, "texture_root": { "type": ["string", "null"] }, "max_dimension": { "type": "integer", "minimum": 1, "maximum": 4096 }, "processor": { "$ref": "#/$defs/processor" }, "consumed_inputs": { "type": "array", "minItems": 2, "items": { "$ref": "#/$defs/consumed_input" } }, "emitted_textures": { "type": "array", "minItems": 2, "items": { "$ref": "#/$defs/emitted_texture" } } }, "additionalProperties": false },
    "processor": { "type": "object", "required": ["image_crate", "png_crate", "jpeg_crate", "base_color_algorithm", "normal_algorithm", "data_algorithm", "output_encoding"], "properties": { "image_crate": { "const": "image@0.25.10" }, "png_crate": { "const": "png@0.18.1" }, "jpeg_crate": { "const": "zune-jpeg@0.5.15" }, "base_color_algorithm": { "const": "sRGB-to-linear premultiplied-alpha Lanczos3" }, "normal_algorithm": { "const": "tangent-vector Triangle renormalize +Z fallback" }, "data_algorithm": { "const": "linear-channel Triangle" }, "output_encoding": { "const": "PNG RGBA8 compression=Best filter=NoFilter" } }, "additionalProperties": false },
    "dimensions": { "type": "array", "items": { "type": "integer", "minimum": 1, "maximum": 4096 }, "minItems": 2, "maxItems": 2 },
    "slot": { "enum": ["base_color", "normal", "metallic_roughness", "occlusion"] },
    "consumed_input": { "type": "object", "required": ["material_index", "material_name", "slot", "declared_path", "mime", "dimensions"], "properties": { "material_index": { "type": "integer", "minimum": 0 }, "material_name": { "type": "string" }, "slot": { "$ref": "#/$defs/slot" }, "declared_path": { "type": "string" }, "mime": { "enum": ["image/png", "image/jpeg"] }, "dimensions": { "$ref": "#/$defs/dimensions" } }, "additionalProperties": false },
    "emitted_texture": { "type": "object", "required": ["material_index", "material_name", "slot", "declared_path", "mime", "dimensions", "resized", "emitted_bytes"], "properties": { "material_index": { "type": "integer", "minimum": 0 }, "material_name": { "type": "string" }, "slot": { "$ref": "#/$defs/slot" }, "declared_path": { "type": "string" }, "mime": { "enum": ["image/png", "image/jpeg"] }, "dimensions": { "$ref": "#/$defs/dimensions" }, "resized": { "type": "boolean" }, "emitted_bytes": { "type": "integer", "minimum": 0 } }, "additionalProperties": false }
  }
}
