リギングAPI

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

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


POST/openapi/v1/rigging

リギングタスクの作成

このエンドポイントを使用すると、指定された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面を超えています。リギングの前にリメッシュAPIを使用して面の数を減らしてください。
  • Name
    401 - Unauthorized
    Description

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

  • 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

リギングタスクを取得する

このエンドポイントを使用すると、有効なタスクidを指定してリギングタスクを取得できます。リギングタスクオブジェクトを参照して、含まれるプロパティを確認してください。

パラメータ

  • Name
    id
    Type
    path
    Description

    取得するリギングタスクの一意の識別子。

戻り値

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

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

リギングタスクの削除

このエンドポイントは、関連するすべてのモデルとデータを含むリギングタスクを永久に削除します。この操作は元に戻せません。

パスパラメータ

  • Name
    id
    Type
    path
    Description

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

戻り値

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

リクエスト

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}"

レスポンス

// Returns 200 Ok on success.

GET/openapi/v1/rigging

リギングタスクの一覧

呼び出し元のリギングタスクのページネーションされたリストを、新しいものから順に返します。標準的なページネーションは page_numpage_size を使用します。

APIを通じて作成されたタスクはAPIを通じて管理されます — それらはウェブアプリのマイアセットには表示されません。このエンドポイントを使用して、IDを失ったタスクを見つけてください。

Request

GET
/openapi/v1/rigging
curl "https://api.meshy.ai/openapi/v1/rigging?page_num=1&page_size=20" \
-H "Authorization: Bearer ${YOUR_API_KEY}"

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

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

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

パラメータ

  • Name
    id
    Type
    path
    Description

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

戻り値

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

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
}