覆盖文生 3D、图生 3D、多视图、批量生成,以及重拓扑、绑定、动画、智能分割、 纹理、PBR、智能 UV、部件补全、格式导出与下载。 代码组织:一个功能一个模块(tripo/features/),入口薄壳 tripocli.py。
25 lines
750 B
Python
25 lines
750 B
Python
"""文生 3D — text to model.
|
||
|
||
tripocli text -p "a low-poly wooden barrel" --smart-mesh --wait -o barrel.glb
|
||
"""
|
||
|
||
from . import _common
|
||
|
||
NAME = "text"
|
||
HELP = "文本生成 3D 模型(文生 3D)"
|
||
|
||
|
||
def add_arguments(parser):
|
||
parser.add_argument("-p", "--prompt", required=True, help="模型描述提示词(英文效果更佳)")
|
||
_common.add_generation_options(parser)
|
||
_common.add_wait_options(parser, "生成完成后保存的 .glb 路径")
|
||
|
||
|
||
def run(ctx):
|
||
args = ctx.args
|
||
body = _common.generation_body(args)
|
||
data = ctx.client.get_data(
|
||
"POST", "/v2/studio/operation/text_to_model", body={"prompt": args.prompt, **body}
|
||
)
|
||
return _common.finish_single(ctx, data, output=args.output, wait=args.wait)
|