Animasyon API'si

Mevcut animasyonları keşfetmeye ve bunları rig uygulanmış karakterlere uygulamaya yönelik endpoint'ler.


POST/openapi/v1/animations

Animasyon Görevi Oluştur

Bu uç nokta, daha önce rigging uygulanmış bir karaktere belirli bir animasyon eylemi uygulamak için yeni bir görev oluşturmanıza olanak tanır. Son işleme seçeneklerini içerir.

Parametreler

  • Name
    rig_task_id
    Type
    string
    Zorunlu
    Description

    Başarıyla tamamlanmış bir rigging görevinin id değeri (POST /openapi/v1/rigging üzerinden). Bu görevdeki karakter animasyonlandırılacaktır.

  • Name
    action_id
    Type
    integer
    Zorunlu
    Description

    Uygulanacak animasyon eyleminin tanımlayıcısı. Mevcut animasyonların tam listesi için Animasyon kütüphanesi Referansı bölümüne bakın.

  • Name
    post_process
    Type
    object
    Description

    Animasyon çıktısı için isteğe bağlı son işleme. Standart animasyon dosyalarını almak için bunu atlayın.

Yalnızca şu durumlarda geçerli post_process is set
  • Name
    operation_type
    Type
    string
    Zorunlu
    Description

    Gerçekleştirilecek işlemin türü. Mevcut değerler: change_fps, fbx2usdz, extract_armature.

  • Name
    fps
    Type
    integer
    varsayılan 30
    Description

    Hedef kare hızı. Yalnızca operation_type değeri change_fps olduğunda geçerlidir. İzin verilen değerler: 24, 25, 30, 60.

Döndürür

Yanıtın result özelliği, yeni oluşturulan animasyon görevinin görev id değerini içerir.

Hata Modları

  • Name
    400 - Bad Request
    Description

    İstek kabul edilemezdi. Yaygın nedenler:

    • Eksik parametre: rig_task_id veya action_id eksik.
    • Geçersiz rig görevi: rig_task_id geçersiz veya başarısız/var olmayan bir göreve başvuruyor.
    • Geçersiz eylem ID'si: action_id geçerli bir animasyona karşılık gelmiyor.
  • Name
    401 - Unauthorized
    Description

    Kimlik doğrulama başarısız oldu. Lütfen API anahtarınızı kontrol edin.

  • Name
    402 - Payment Required
    Description

    Bu görevi gerçekleştirmek için yetersiz kredi.

  • Name
    404 - Not Found
    Description

    rig_task_id ile belirtilen rigging görevi bulunamadı.

  • Name
    429 - Too Many Requests
    Description

    Hız sınırınızı aştınız.

Request

POST
/openapi/v1/animations
# Animate a rigged model with required params only
curl https://api.meshy.ai/openapi/v1/animations \
  -X POST \
  -H "Authorization: Bearer ${YOUR_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "rig_task_id": "018b314a-a1b5-716d-c222-2f1776f7f579",
    "action_id": 92
  }'

# With post-processing to change FPS
curl https://api.meshy.ai/openapi/v1/animations \
  -X POST \
  -H "Authorization: Bearer ${YOUR_API_KEY}" \
  -H 'Content-Type: application/json' \
  -d '{
    "rig_task_id": "018b314a-a1b5-716d-c222-2f1776f7f579",
    "action_id": 92,
    "post_process": {
      "operation_type": "change_fps",
      "fps": 24
    }
  }'

Response

{
  "result": "018c425b-b2c6-727e-d333-3c1887i9h791"
}

GET/openapi/v1/animations/:id

Bir Animasyon Görevini Al

Bu uç nokta, geçerli bir görev id verildiğinde bir animasyon görevini almanızı sağlar. Hangi özelliklerin dahil olduğunu görmek için Animasyon Görevi Nesnesi bölümüne bakın.

Parametreler

  • Name
    id
    Type
    path
    Description

    Alınacak animasyon görevi için benzersiz tanımlayıcı.

Döndürür

Yanıt, Animasyon Görevi nesnesini içerir. Ayrıntılar için Animasyon Görevi Nesnesi bölümünü kontrol edin.

Request

GET
/openapi/v1/animations/018c425b-b2c6-727e-d333-3c1887i9h791
curl https://api.meshy.ai/openapi/v1/animations/018c425b-b2c6-727e-d333-3c1887i9h791 
  -H "Authorization: Bearer ${YOUR_API_KEY}"

Response

{
  "id": "018c425b-b2c6-727e-d333-3c1887i9h791",
  "type": "animate",
  "status": "SUCCEEDED",
  "created_at": 1747032440896,
  "progress": 100,
  "started_at": 1747032441210,
  "finished_at": 1747032457530,
  "expires_at": 1747291657530,
  "task_error": {

    "message": ""

  },

  "consumed_credits": 3,
  "result": {
    "animation_glb_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/Animation_Reaping_Swing_withSkin.glb?Expires=...",
    "animation_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/Animation_Reaping_Swing_withSkin.fbx?Expires=...",
    "processed_usdz_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/processed.usdz?Expires=...",
    "processed_armature_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/processed_armature.fbx?Expires=...",
    "processed_animation_fps_fbx_url": "https://assets.meshy.ai/0630d47c-84b8-4d37-bc02-69e45d9272c1/tasks/018c425b-b2c6-727e-d333-3c1887i9h791/output/processed_60fps.fbx?Expires=..."
  },
  "preceding_tasks": 0
}

DELETE/openapi/v1/animations/:id

Bir Animasyon Görevini Sil

Bu uç nokta, ilişkili tüm modeller ve veriler dahil olmak üzere bir animasyon görevini kalıcı olarak siler. Bu işlem geri alınamaz.

Yol Parametreleri

  • Name
    id
    Type
    path
    Description

    Silinecek animasyon görevinin ID'si.

Dönen Değerler

Başarılı olduğunda 200 OK döndürür.

Request

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

Response

// Returns 200 Ok on success.

GET/openapi/v1/animations/:id/stream

Bir Animasyon Görevini Akış Olarak Aktar

Bu uç nokta, Server-Sent Events (SSE) kullanarak bir Animasyon görevi için gerçek zamanlı güncellemeleri akış olarak aktarır.

Parametreler

  • Name
    id
    Type
    path
    Description

    Akış olarak aktarılacak Animasyon görevi için benzersiz tanımlayıcı.

Döndürür

Server-Sent Events olarak Animasyon Görevi Nesneleri akışını döndürür.

PENDING veya IN_PROGRESS görevleri için yanıt akışı yalnızca gerekli progress ve status alanlarını içerir.

Request

GET
/openapi/v1/animations/018c425b-b2c6-727e-d333-3c1887i9h791/stream
curl -N https://api.meshy.ai/openapi/v1/animations/018c425b-b2c6-727e-d333-3c1887i9h791/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": "018c425b-b2c6-727e-d333-3c1887i9h791",
  "progress": 0,
  "status": "PENDING"
}

event: message
data: {
  "id": "018c425b-b2c6-727e-d333-3c1887i9h791",
  "progress": 50,
  "status": "IN_PROGRESS"
}

event: message
data: { // Example of a SUCCEEDED task stream item, mirroring The Animation Task Object structure
  "id": "018c425b-b2c6-727e-d333-3c1887i9h791",
  "type": "animate",
  "status": "SUCCEEDED",
  "created_at": 1747032440896,
  "progress": 100,
  "started_at": 1747032441210,
  "finished_at": 1747032457530,
  "expires_at": 1747291657530,
  "task_error": {

    "message": ""

  },

  "consumed_credits": 3,
  "result": {
    "animation_glb_url": "https://assets.meshy.ai/.../Animation_Reaping_Swing_withSkin.glb?...",
    "animation_fbx_url": "https://assets.meshy.ai/.../Animation_Reaping_Swing_withSkin.fbx?...",
    "processed_usdz_url": "https://assets.meshy.ai/.../processed.usdz?...",
    "processed_armature_fbx_url": "https://assets.meshy.ai/.../processed_armature.fbx?...",
    "processed_animation_fps_fbx_url": "https://assets.meshy.ai/.../processed_60fps.fbx?..."
  },
  "preceding_tasks": 0
}

Animasyon Görevi Nesnesi

Animasyon Görevi nesnesi, bir animasyonu rig'lenmiş bir karaktere uygulamaya yönelik çalışma birimini temsil eder.

Özellikler

  • Name
    id
    Type
    string
    Description

    Görev için benzersiz tanımlayıcı.

  • Name
    type
    Type
    string
    Description

    Animation görevinin türü. Değer animate olur.

  • Name
    status
    Type
    string
    Description

    Görevin durumu. Olası değerler: PENDING, IN_PROGRESS, SUCCEEDED, FAILED, CANCELED.

  • Name
    progress
    Type
    integer
    Description

    Görevin progress değeri (0-100).

  • Name
    created_at
    Type
    timestamp
    Description

    Görevin oluşturulduğu zaman damgası (epoch'tan bu yana milisaniye).

  • Name
    started_at
    Type
    timestamp
    Description

    Görevin işlenmeye başladığı zaman damgası (epoch'tan bu yana milisaniye). Başlatılmadıysa 0.

  • Name
    finished_at
    Type
    timestamp
    Description

    Görevin tamamlandığı zaman damgası (epoch'tan bu yana milisaniye). Tamamlanmadıysa 0.

  • Name
    expires_at
    Type
    timestamp
    Description

    Görev sonucu asset öğelerinin süresinin dolduğu zaman damgası (epoch'tan bu yana milisaniye).

  • Name
    task_error
    Type
    object
    Description

    Başarısız görevler için hata ayrıntıları. Tam task_error nesne referansı için Hatalar bölümüne bakın.

  • Name
    consumed_credits
    Type
    integer
    Description

    Bu görev tarafından tüketilen kredi sayısı. Görev durumu PENDING, IN_PROGRESS veya SUCCEEDED olduğunda bulunur. FAILED görevleri için 0 döndürür (başarısızlık durumunda krediler iade edilir).

  • Name
    result
    Type
    object
    Description

    Görev SUCCEEDED olduysa çıktı animasyon URL'lerini içerir.

    • Name
      animation_glb_url
      Type
      string
      Description
      GLB formatındaki animasyon için indirilebilir URL.
    • Name
      animation_fbx_url
      Type
      string
      Description
      FBX formatındaki animasyon için indirilebilir URL.
    • Name
      processed_usdz_url
      Type
      string
      Description
      USDZ formatındaki işlenmiş animasyon için indirilebilir URL.
    • Name
      processed_armature_fbx_url
      Type
      string
      Description
      FBX formatındaki işlenmiş iskelet için indirilebilir URL.
    • Name
      processed_animation_fps_fbx_url
      Type
      string
      Description
      FBX formatında FPS'i değiştirilmiş animasyon için indirilebilir URL (örn. change_fps işlemi kullanıldıysa).
  • Name
    preceding_tasks
    Type
    integer
    Description

    Kuyruktaki önceki görevlerin sayısı. Yalnızca durum PENDING ise anlamlıdır.

Example Animation Task Object

{
  "id": "018c425b-b2c6-727e-d333-3c1887i9h791",
  "type": "animate",
  "status": "SUCCEEDED",
  "created_at": 1747032440896,
  "progress": 100,
  "started_at": 1747032441210,
  "finished_at": 1747032457530,
  "expires_at": 1747291657530,
  "task_error": {

    "message": ""

  },

  "consumed_credits": 3,
  "result": {
    "animation_glb_url": "https://assets.meshy.ai/.../Animation_Reaping_Swing_withSkin.glb?...",
    "animation_fbx_url": "https://assets.meshy.ai/.../Animation_Reaping_Swing_withSkin.fbx?...",
    "processed_usdz_url": "https://assets.meshy.ai/.../processed.usdz?...",
    "processed_armature_fbx_url": "https://assets.meshy.ai/.../processed_armature.fbx?...",
    "processed_animation_fps_fbx_url": "https://assets.meshy.ai/.../processed_60fps.fbx?..."
  },
  "preceding_tasks": 0
}