# Jyaan AI Object Reference

Jyaan Object Import Format Version: 1

This document defines the JSON format used to build or edit a Jyaan master object with an external AI.
Copy the generated JSON and choose 貼り付け in Jyaan's object editor. The result is applied as an unsaved draft.

## Current public data

Always read the live catalog immediately before generating JSON:

- https://jyaan.com/ai/catalog.json (JSON, no cache)
- https://jyaan.com/docs/ai/catalog.md (Markdown, no cache)

The catalog contains every public scene template, object/type, and texture currently available to all users.

## Output rules

- 出力は有効なJSONだけにし、コメントや説明文をJSON内部へ含めないこと。
- types[].idはこのJSON内で一意な、人間が読みやすいIDにすること。保存時にJyaanがUUIDへ変換する。
- 同じJSON内のタイプを複合オブジェクトの子にする場合はtypeRef、公開カタログ内の既存タイプを再利用する場合はpublicTypeIdを使うこと。
- publicTypeIdは /ai/catalog.json に現在掲載されているIDだけを使用すること。推測でIDを作らないこと。
- position・rotation・scaleは[x, y, z]。位置とサイズはメートル、回転は度で指定すること。
- shapeがmodelの場合はmodelUrl、web-screenの場合は表示するURLをmodelUrlに指定すること。
- 貼り付けは未保存ドラフトに反映される。サーバーへ直接書き込む公開APIではない。

## JSON Schema

https://jyaan.com/ai/object-schema.json

## Complete example

```json
{
  "version": 1,
  "object": {
    "name": "案内標識",
    "description": "支柱と看板を組み合わせた案内用オブジェクト",
    "tags": [
      "道路",
      "その他"
    ],
    "types": [
      {
        "id": "post",
        "name": "支柱",
        "shape": "cylinder",
        "size": {
          "x": 0.12,
          "y": 2.2,
          "z": 0.12
        },
        "primitiveFaces": {
          "side": {
            "value": "#777777",
            "offsetX": 0,
            "offsetY": 0,
            "scaleX": 1,
            "scaleY": 1
          }
        }
      },
      {
        "id": "board",
        "name": "看板",
        "shape": "box",
        "size": {
          "x": 1.8,
          "y": 0.7,
          "z": 0.08
        },
        "boxFaces": {
          "front": [
            [
              "#2563eb"
            ]
          ],
          "back": [
            [
              "#2563eb"
            ]
          ]
        }
      },
      {
        "id": "main",
        "name": "標準",
        "shape": "composite",
        "children": [
          {
            "name": "支柱",
            "typeRef": "post",
            "position": [
              0,
              1.1,
              0
            ]
          },
          {
            "name": "看板",
            "typeRef": "board",
            "position": [
              0,
              2.05,
              0
            ]
          }
        ]
      }
    ]
  }
}
```
