覆盖文生 3D、图生 3D、多视图、批量生成,以及重拓扑、绑定、动画、智能分割、 纹理、PBR、智能 UV、部件补全、格式导出与下载。 代码组织:一个功能一个模块(tripo/features/),入口薄壳 tripocli.py。
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
"""PBR — generate metallic/roughness/normal maps.
|
|
|
|
tripocli pbr -p <project_id> --wait -o pbr.glb
|
|
|
|
Endpoint ``/operation/pbr_generate``. Verified live: it needs the project's
|
|
``model_version`` **and** ``part_name_list`` (``tripo_node_<operator_id>``) —
|
|
without the node list the task is accepted but fails at 100%.
|
|
"""
|
|
|
|
from . import _common
|
|
|
|
NAME = "pbr"
|
|
HELP = "PBR:生成金属度/粗糙度/法线等物理材质贴图"
|
|
|
|
|
|
def add_arguments(parser):
|
|
_common.add_op_options(parser, "PBR 结果保存到该路径(可选)")
|
|
|
|
|
|
def run(ctx):
|
|
args = ctx.args
|
|
model_version = _common.project_version(ctx.client, args.project, args.model)
|
|
if not model_version:
|
|
raise ValueError(f"无法读取项目 {args.project} 的 model_version,请用 -m 显式指定")
|
|
|
|
body = {
|
|
"project_id": args.project,
|
|
"model_version": model_version,
|
|
"part_name_list": _common.node_part_name(ctx.client, args.project),
|
|
}
|
|
data = ctx.client.get_data("POST", "/v2/studio/operation/pbr_generate", body=body)
|
|
return _common.run_operator(ctx, data, output=args.output, wait=args.wait, label="PBR 生成")
|