tripocli v2.0.0:Tripo AI 3D 生成与加工 CLI(面向 Agent 与开发者,纯 Python 标准库、零第三方依赖)
覆盖文生 3D、图生 3D、多视图、批量生成,以及重拓扑、绑定、动画、智能分割、 纹理、PBR、智能 UV、部件补全、格式导出与下载。 代码组织:一个功能一个模块(tripo/features/),入口薄壳 tripocli.py。
This commit is contained in:
commit
977f97995a
60 files changed
+5622
No files matched your search
@@ -0,0 +1,36 @@
|
||||
"""资产列表 — list the account's generated assets.
|
||||
|
||||
tripocli assets --type model --page 1
|
||||
|
||||
The API takes two filters: ``asset_type`` (scope, verified value: ``mine``) and
|
||||
``type`` (the asset kind, e.g. ``model``).
|
||||
"""
|
||||
|
||||
NAME = "assets"
|
||||
HELP = "列出账号资产(模型/图片)"
|
||||
|
||||
|
||||
def add_arguments(parser):
|
||||
parser.add_argument("--type", default="model", help="资产种类,默认 model")
|
||||
parser.add_argument("--asset-type", default="mine", help="资产范围,默认 mine")
|
||||
parser.add_argument("--page", type=int, default=1, help="页码")
|
||||
parser.add_argument("--size", type=int, default=20, help="每页数量")
|
||||
|
||||
|
||||
def run(ctx):
|
||||
args = ctx.args
|
||||
data = ctx.client.assets(
|
||||
asset_type=args.asset_type, type=args.type, page=args.page, size=args.size
|
||||
) or {}
|
||||
projects = data.get("projects") or []
|
||||
|
||||
def show():
|
||||
ctx.out.line(f"共 {data.get('total', len(projects))} 个资产(当前显示 {len(projects)} 个)")
|
||||
for item in projects:
|
||||
pid = item.get("id") or item.get("project_id") or ""
|
||||
name = item.get("project_name") or (item.get("biz_info") or {}).get("short_description") or ""
|
||||
cat = item.get("category") or item.get("type") or ""
|
||||
ctx.out.line(f" {pid} [{cat}] {name}")
|
||||
|
||||
ctx.out.data(data, human=show)
|
||||
return data
|
||||
Reference in new issue
Block a user