feat: full format compatibility adaptation for model downloads

- Add get_model_urls() and download_model() to api.py and api_complete.py
  supporting all 14 discovered urlResult format keys (glb, obj, pbr maps, etc.)
- Update generator.py to extract full urlResult dict instead of just modelUrl
- Add CLI subcommands: formats (list available formats) and download (fetch by key)
- Update reverse engineering docs with complete format key table and CLI examples
This commit is contained in:
KawasakiAkasei
2026-05-27 11:59:48 +08:00
parent 58ab0d6655
commit ad3c86b8ba
6 changed files with 261 additions and 9 deletions

View File

@@ -131,6 +131,16 @@ api = Hunyuan3DAPIComplete()
result = api.generate_from_image(resource_url, title="我的模型")
```
### 4. CLI 下载模型
```bash
# 列出某个创作所有可用的下载格式
hunyuan3dweb formats <creation_id>
# 下载指定格式(默认 glb
hunyuan3dweb download <creation_id> --format glb -o model.glb
```
---
## API 端点
@@ -150,6 +160,27 @@ result = api.generate_from_image(resource_url, title="我的模型")
| 全局配置 | GET | `/config` | 查询参数 |
| 动画模板 | GET | `/workflow/action/templates` | 查询参数 |
### 模型下载格式
`/creations/detail` 返回的 `urlResult` 字段最多包含 14 种格式键:
| 键名 | 说明 |
|-----|------|
| `glb` | 带 PBR 贴图的 GLB 二进制模型 |
| `obj` | OBJ 模型(通常打包在 zip 中) |
| `mtl` | MTL 材质文件 |
| `obj_url` | 独立 OBJ 文件 URL |
| `geometryGlb` | 纯几何 GLB无材质 |
| `textureGlb` | GLB 纹理包 |
| `textureObj` | OBJ 纹理包 |
| `image_url` | 预览图/缩略图 |
| `pbrImage` | PBR 综合贴图 |
| `pbrMetallicImage` | PBR 金属度贴图 |
| `pbrRoughnessImage` | PBR 粗糙度贴图 |
| `pbrNormalImage` | PBR 法线贴图 |
| `invisible_wall` | 不可见碰撞墙 |
| `air_wall` | 空气墙(碰撞体) |
---
## 技术细节