Rigging Check API
在对模型进行 rig 之前,先了解 Meshy 能否为该模型进行 rig 和动画制作,以及它适合哪种 animation_type。要对模型进行 rig,请参阅 Rigging。
创建一个 Rigging Check 任务
创建一个 Rigging Check 任务,并返回 task 对象。该任务会检查 Meshy 能否为你某个任务的模型进行 rig 和动画制作,以及它适合哪种 animation_type。它会在后台运行。要读取其结果,请参阅获取结果。
此检查是可选的。你可以不经过此检查直接创建一个 Rigging 任务,它的结果不会改变 Rigging 的行为。它能帮助你跳过 Rigging 不支持的模型,例如汽车或小鸟。
该检查会查看任务的预览图片。当模型满足以下所有规则时,riggable 为 true:
- 模型中只有一个角色。
- 该角色是人形(双足)或四足动物(四足)。
- 角色是站立的,四足动物则需四肢着地站立。
- 手臂和腿与身体及彼此之间分离清晰。
- 角色没有站在底座或基座上。
- 角色面朝正前方。
- 面数在 Rigging 的面数限制之内。
Request
# Check whether a model can be rigged
curl https://api.meshy.ai/openapi/v2/rigging/check \
-X POST \
-H "Authorization: Bearer ${MESHY_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578"
}'
Response
{
"id": "0193c1a2-5b7e-7d4f-9a3c-8e2f1b6d4c70",
"type": "rig-check",
"status": "PENDING",
"progress": 0,
"created_at": 1790640079880,
"started_at": null,
"finished_at": null,
"expires_at": null,
"preceding_tasks": 1,
"consumed_credits": 1,
"task_error": null,
"input": {
"input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578"
},
"output": null
}
参数
- Name
- input_task_id
- Type
- string
- 必选
- Description
你想要检查的模型所属任务的
id。它必须是你的某个已经SUCCEEDED且具有预览图片的 API 任务,例如 Text to 3D、Image to 3D、Remesh 或 Retexture 任务。
返回值
202 Accepted,附带 task 对象,你的请求内容位于 input 中。
两个响应头能帮助你读取任务:
Location:该任务在 Tasks 上的 URLRetry-After:在任务尚未完成时,首次读取前应等待的秒数
失败模式
- Name
400 - Bad Request- Description
请求无法运行。例如:
- 未发送
input_task_id。错误代码为parameter_missing。 input_task_id与你的任何任务都不匹配。错误代码为input_task_not_found。input_task_id中的任务不是通过 API 创建的。错误代码为input_task_unsupported。input_task_id中的任务尚未成功完成。错误代码为input_task_not_ready。请等到其状态变为SUCCEEDED,然后重试。- 请求中包含该检查不支持的参数,例如
model_url。错误代码为parameter_unknown。
错误信息会说明发现了什么问题。修正请求后再次发送。参阅 Errors。
- 未发送
- Name
401 - Unauthorized- Description
API key 缺失或无效。请检查
Authorization请求头。
- Name
402 - Payment Required- Description
以下情况之一适用:
- 账户的积分不足。
- 账户已达到积分限额。
- 账户处于免费方案。
请检查你的积分和方案,然后重试。
- Name
403 - Forbidden- Description
input_task_id是一个浮雕模型,Meshy 无法对其进行检查。错误代码为input_task_unsupported。请发送另一个模型。
- Name
404 - Not Found- Description
Meshy 无法检查
input_task_id中的任务。错误代码说明了原因:input_task_unsupported:该任务没有预览图片,例如 Convert、尺寸调整 或 文字生成影像 任务。请检查其来源任务。input_task_expired:该任务的文件已被删除。请重新创建该任务,然后发送该任务的id。
- Name
429 - Too Many Requests- Description
达到以下限制之一:
- 你发送的请求过多。请等待
Retry-After中的秒数后重试。 - 你排队或正在运行的任务过多。请等待部分任务完成后再重试。
- 你发送的请求过多。请等待
Meshy 已创建的任务仍可能失败。其 status 会变为 FAILED,Meshy 会退还积分,并且 task_error 会说明原因:
task_error.code为moderation_blocked,且type为invalid_input:模型的预览图片可能不符合 Meshy 的平台规则。请发送另一个模型。task_error.type为service_unavailable,且code为null:Meshy 无法检查该模型。请重新创建该任务。
参阅 Errors。
获取结果
读取 Rigging Check 任务的方式与读取其他所有 v2 任务相同,均通过 Tasks 路由进行。要仅列出 Rigging Check 任务,请使用 type=rig-check 进行筛选。
| 目的 | 调用 |
|---|---|
| 获取单个任务 | GET /openapi/v2/tasks/{id} |
| 等待更新 | GET /openapi/v2/tasks/{id}/stream 或 webhook |
| 列出你的任务 | GET /openapi/v2/tasks?type=rig-check |
| 删除任务 | DELETE /openapi/v2/tasks/{id} |
Rigging Check 输出
任务成功时,output 中包含以下字段。task 对象的其余部分对每种任务类型都相同。output 不包含任何文件 URL。
Succeeded Rigging Check task
{
"id": "0193c1a2-5b7e-7d4f-9a3c-8e2f1b6d4c70",
"type": "rig-check",
"status": "SUCCEEDED",
"progress": 100,
"created_at": 1790640079880,
"started_at": 1790640080112,
"finished_at": 1790640086935,
"expires_at": 1790899286935,
"preceding_tasks": 0,
"consumed_credits": 1,
"task_error": null,
"input": {
"input_task_id": "018a210d-8ba4-705c-b111-1f1776f7f578"
},
"output": {
"riggable": false,
"animation_type": "biped",
"animatable": false,
"reasons": [
{
"code": "limbs_not_separated",
"message": "The arms or legs touch the body or each other. Generate it in a T-pose or A-pose with the limbs clear of the body."
}
]
}
}
- Name
- riggable
- Type
- boolean
- Description
模型是否满足本页上的所有规则。当其为
false时,reasons会说明原因。
- Name
- animation_type
- Type
- string
- Description
模型所属的角色类型,即使
riggable为false时也会给出。可用值:
biped:人形角色。在创建 Rigging 任务时将其作为animation_type发送。quadruped:四足动物。在创建 Rigging 任务时将其作为animation_type发送。other:其他任何类型,例如鸟、章鱼或道具。Rigging 不支持此类模型。
- Name
- animatable
- Type
- boolean
- Description
对模型进行 rig 后,Animation 能否为其制作动画。当
riggable为false时,它绝不会为true。
- Name
- reasons
- Type
- array
- Description
riggable或animatable为false的原因,按固定顺序排列。当两者均为true时,它是一个空数组。- Name
code- Type
- string
- Description
模型存在的问题,供你的代码据此处理。Meshy 可能会新增代码,因此请将你不认识的代码视为模型不符合要求的原因。
可用值:
- Name
message- Type
- string
- Description
与
code相同原因的一句话说明,面向用户,并附带如何修正模型的方法。对于too_many_faces,它会给出模型的三角面数和应使用的 Remesh 设置。措辞可能会发生变化,因此请基于code而非message进行分支判断。