リギング API

Rigging API を使用すると、3D ヒューマノイドモデルにプログラムでスケルトン(アーマチュア)を追加し、メッシュをそれにバインドして、アニメーションに使用できる状態にできます。リギング済みキャラクターにアニメーションを適用する場合は、Animation API を参照してください。

現在、プログラムによるリギングは、四肢と身体構造が明確に定義された標準的なヒューマノイド(二足歩行)アセットでのみ良好に機能する点にご注意ください。


POST/openapi/v1/rigging

リギングタスクの作成

この endpoint では、指定された 3D モデルに対して新しいリギングタスクを作成できます。正常に完了すると、標準形式のリギング済みキャラクターと、オプションで基本的な歩行/走行アニメーションが提供されます。

現在、自動リギングは以下のモデルには適していません。

  • テクスチャのないメッシュ
  • 非ヒューマノイドのアセット
  • 四肢や胴体の構造が不明瞭なヒューマノイドアセット

パラメータ

  • Name
    input_task_id
    Type
    string
    必須
    Description

    リギングする必要がある入力タスクです。現在、テクスチャ付きのヒューマノイドモデルをサポートしています。

  • Name
    model_url
    Type
    string
    必須
    Description

    Meshy がリギングする 3D モデルを、公開アクセス可能な URL または Data URI で提供してください。現在、テクスチャ付きのヒューマノイド GLB ファイル(.glb 形式)をサポートしています。

  • Name
    height_meters
    Type
    number
    デフォルト 1.7
    Description

    キャラクターモデルのおおよその高さ(メートル単位)です。スケーリングとリギング精度の向上に役立ちます。正の数である必要があります。

  • Name
    texture_image_url
    Type
    string
    Description

    モデルの UV 展開済みベースカラーテクスチャ画像です。公開アクセス可能な URL または Data URI を指定してください。現在、.png 形式をサポートしています。

戻り値

レスポンスの result プロパティには、新しく作成されたリギングタスクのタスク id が含まれます。

失敗モード

  • Name
    400 - Bad Request
    Description

    リクエストは受け付けられませんでした。一般的な原因:

    • パラメータ不足: model_url または input_task_id のいずれかを指定する必要があります。
    • 無効なモデル形式: model_url がサポートされていない拡張子のファイルを指しています(.glb のみ対応)。
    • 到達不能な URL: model_url をダウンロードできませんでした。
    • 無効な入力タスク: input_task_id が有効な API タスクを参照していません。
    • 面数超過: 入力モデルの面数が 300,000 を超えています。リギング前に Remesh API を使用して面数を削減してください。
  • Name
    401 - Unauthorized
    Description

    認証に失敗しました。API key を確認してください。

  • Name
    402 - Payment Required
    Description

    このタスクを実行するためのクレジットが不足しています。

  • Name
    422 - Unprocessable Entity
    Description

    姿勢推定に失敗しました。提供されたモデルが有効なヒューマノイドキャラクターではない可能性があります。

  • Name
    429 - Too Many Requests
    Description

    レート制限を超過しました。

Request

POST
/openapi/v1/rigging
# Rig a model from a URL
curl https://api.meshy.ai/openapi/v1/rigging \
  -X POST \
  -H "Authorization: Bearer ${YOUR_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "model_url": "YOUR_MODEL_URL_OR_DATA_URI",
    "height_meters": 1.8
  }'

Response

{
  "result": "018b314a-a1b5-716d-c222-2f1776f7f579"
}

GET/openapi/v1/rigging/:id

Riggingタスクを取得する

このendpointでは、有効なタスク id を指定してRiggingタスクを取得できます。含まれるプロパティについては、Riggingタスクオブジェクトを参照してください。

パラメータ

  • Name
    id
    Type
    path
    Description

    取得するRiggingタスクの一意の識別子。

戻り値

レスポンスにはRiggingタスクオブジェクトが含まれます。詳細はRiggingタスクオブジェクトセクションを確認してください。

Request

GET
/openapi/v1/rigging/018b314a-a1b5-716d-c222-2f1776f7f579
curl https://api.meshy.ai/openapi/v1/rigging/018b314a-a1b5-716d-c222-2f1776f7f579 
  -H "Authorization: Bearer ${YOUR_API_KEY}"

Response

{
  "id": "018b314a-a1b5-716d-c222-2f1776f7f579",
  "type": "rig",
  "status": "SUCCEEDED",
  "created_at": 1747032400453,
  "progress": 100,
  "started_at": 1747032401314,
  "finished_at": 1747032418417,
  "expires_at": 1747291618417,
  "task_error": {

    "message": ""

  },

  "consumed_credits": 5,
  "result": {
    "rigged_character_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Character_output.fbx?Expires=...",
    "rigged_character_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Character_output.glb?Expires=...",
    "basic_animations": {
      "walking_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Walking_withSkin.glb?Expires=...",
      "walking_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Walking_withSkin.fbx?Expires=...",
      "walking_armature_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Walking_withSkin_armature.glb?Expires=...",
      "running_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Running_withSkin.glb?Expires=...",
      "running_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Running_withSkin.fbx?Expires=...",
      "running_armature_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Running_withSkin_armature.glb?Expires=..."
    }
  },
  "preceding_tasks": 0
}

DELETE/openapi/v1/rigging/:id

リギングタスクを削除する

この endpoint は、関連するすべてのモデルとデータを含むリギングタスクを完全に削除します。この操作は元に戻せません。

パスパラメータ

  • Name
    id
    Type
    path
    Description

    削除するリギングタスクの ID。

戻り値

成功時に 200 OK を返します。

Request

DELETE
/openapi/v1/rigging/018b314a-a1b5-716d-c222-2f1776f7f579
curl --request DELETE \
  --url https://api.meshy.ai/openapi/v1/rigging/018b314a-a1b5-716d-c222-2f1776f7f579 \
  -H "Authorization: Bearer ${YOUR_API_KEY}"

Response

// Returns 200 Ok on success.

GET/openapi/v1/rigging/:id/stream

リギングタスクをストリーミングする

このendpointは、Server-Sent Events(SSE)を使用してリギングタスクのリアルタイム更新をストリーミングします。

パラメータ

  • Name
    id
    Type
    path
    Description

    ストリーミングするリギングタスクの一意の識別子。

戻り値

Server-Sent EventsとしてRiggingタスクオブジェクトのストリームを返します。

PENDINGまたはIN_PROGRESSのタスクでは、レスポンスストリームには必要なprogressフィールドとstatusフィールドのみが含まれます。

Request

GET
/openapi/v1/rigging/018b314a-a1b5-716d-c222-2f1776f7f579/stream
curl -N https://api.meshy.ai/openapi/v1/rigging/018b314a-a1b5-716d-c222-2f1776f7f579/stream 
-H "Authorization: Bearer ${YOUR_API_KEY}"

Response Stream

// Error event example
event: error
data: {
  "status_code": 404,
  "message": "Task not found"
}

// Message event examples illustrate task progress.
// For PENDING or IN_PROGRESS tasks, the response stream will not include all fields.
event: message
data: {
  "id": "018b314a-a1b5-716d-c222-2f1776f7f579",
  "progress": 0,
  "status": "PENDING"
}

event: message
data: {
  "id": "018b314a-a1b5-716d-c222-2f1776f7f579",
  "progress": 50,
  "status": "IN_PROGRESS"
}

event: message
data: { // Example of a SUCCEEDED task stream item, mirroring The Rigging Task Object structure
  "id": "018b314a-a1b5-716d-c222-2f1776f7f579",
  "type": "rig",
  "status": "SUCCEEDED",
  "created_at": 1747032400453,
  "progress": 100,
  "started_at": 1747032401314,
  "finished_at": 1747032418417,
  "expires_at": 1747291618417,
  "task_error": {

    "message": ""

  },

  "consumed_credits": 5,
  "result": {
    "rigged_character_fbx_url": "https://assets.meshy.ai/.../Character_output.fbx?...",
    "rigged_character_glb_url": "https://assets.meshy.ai/.../Character_output.glb?...",
    "basic_animations": {
      "walking_glb_url": "https://assets.meshy.ai/.../Animation_Walking_withSkin.glb?...",
      "walking_fbx_url": "https://assets.meshy.ai/.../Animation_Walking_withSkin.fbx?...",
      "walking_armature_glb_url": "https://assets.meshy.ai/.../Animation_Walking_withSkin_armature.glb?...",
      "running_glb_url": "https://assets.meshy.ai/.../Animation_Running_withSkin.glb?...",
      "running_fbx_url": "https://assets.meshy.ai/.../Animation_Running_withSkin.fbx?...",
      "running_armature_glb_url": "https://assets.meshy.ai/.../Animation_Running_withSkin_armature.glb?..."
    }
  },
  "preceding_tasks": 0
}

リギングタスクオブジェクト

リギングタスクオブジェクトは、キャラクターをリギングするための作業単位を表します。

プロパティ

  • Name
    id
    Type
    string
    Description

    タスクの一意の識別子。

  • Name
    type
    Type
    string
    Description

    リギングタスクの種類。値は rig です。

  • Name
    status
    Type
    string
    Description

    タスクのステータス。指定可能な値: PENDING, IN_PROGRESS, SUCCEEDED, FAILED, CANCELED

  • Name
    progress
    Type
    integer
    Description

    タスクの進行状況 (0-100)。未開始の場合は 0、成功した場合は 100

  • Name
    created_at
    Type
    timestamp
    Description

    タスクが作成された時刻のタイムスタンプ (エポックからのミリ秒)。

  • Name
    started_at
    Type
    timestamp
    Description

    タスクの処理が開始された時刻のタイムスタンプ (エポックからのミリ秒)。未開始の場合は 0

  • Name
    finished_at
    Type
    timestamp
    Description

    タスクが終了した時刻のタイムスタンプ (エポックからのミリ秒)。未終了の場合は 0

  • Name
    expires_at
    Type
    timestamp
    Description

    タスク結果のアセットが期限切れとなり、削除される可能性がある時刻のタイムスタンプ (エポックからのミリ秒)。

  • Name
    task_error
    Type
    object
    Description

    失敗したタスクのエラー詳細。完全な task_error オブジェクトのリファレンスについては、エラー を参照してください。

  • Name
    consumed_credits
    Type
    integer
    Description

    このタスクで消費されたクレジット数。タスクのステータスが PENDINGIN_PROGRESS、または SUCCEEDED の場合に存在します。FAILED タスクでは 0 を返します (失敗時にクレジットは返還されます)。

  • Name
    result
    Type
    object
    Description

    タスクが SUCCEEDED の場合は出力アセットの URL を含み、それ以外の場合は null です。

    • Name
      rigged_character_fbx_url
      Type
      string
      Description

      FBX 形式のリギング済みキャラクターのダウンロード可能な URL。

    • Name
      rigged_character_glb_url
      Type
      string
      Description

      GLB 形式のリギング済みキャラクターのダウンロード可能な URL。

    • Name
      basic_animations
      Type
      object (optional)
      Description

      デフォルトアニメーションの URL を含みます。(例: generate_basic_animations が暗黙的に true だった場合、またはデフォルトで有効になっていた場合)。

      • Name
        walking_glb_url
        Type
        string
        Description
        GLB 形式の歩行アニメーションのダウンロード可能な URL (スキン付き)。
      • Name
        walking_fbx_url
        Type
        string
        Description
        FBX 形式の歩行アニメーションのダウンロード可能な URL (スキン付き)。
      • Name
        walking_armature_glb_url
        Type
        string
        Description
        GLB 形式の歩行アニメーションのアーマチュアのダウンロード可能な URL。
      • Name
        running_glb_url
        Type
        string
        Description
        GLB 形式の走行アニメーションのダウンロード可能な URL (スキン付き)。
      • Name
        running_fbx_url
        Type
        string
        Description
        FBX 形式の走行アニメーションのダウンロード可能な URL (スキン付き)。
      • Name
        running_armature_glb_url
        Type
        string
        Description
        GLB 形式の走行アニメーションのアーマチュアのダウンロード可能な URL。
  • Name
    preceding_tasks
    Type
    integer
    Description

    キュー内の先行タスク数。ステータスが PENDING の場合にのみ意味があります。

Example Rigging Task Object

{
  "id": "018b314a-a1b5-716d-c222-2f1776f7f579",
  "type": "rig",
  "status": "SUCCEEDED",
  "created_at": 1747032400453,
  "progress": 100,
  "started_at": 1747032401314,
  "finished_at": 1747032418417,
  "expires_at": 1747291618417,
  "task_error": {

    "message": ""

  },

  "consumed_credits": 5,
  "result": {
    "rigged_character_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Character_output.fbx?Expires=...",
    "rigged_character_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Character_output.glb?Expires=...",
    "basic_animations": {
      "walking_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Walking_withSkin.glb?Expires=...",
      "walking_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Walking_withSkin.fbx?Expires=...",
      "walking_armature_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Walking_withSkin_armature.glb?Expires=...",
      "running_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Running_withSkin.glb?Expires=...",
      "running_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Running_withSkin.fbx?Expires=...",
      "running_armature_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018b314a-a1b5-716d-c222-2f1776f7f579/output/Animation_Running_withSkin_armature.glb?Expires=..."
    }
  },
  "preceding_tasks": 0
}