当前位置: 首页> 文旅> 酒店 > 做一个医院网站多少钱_工业设计公司如何运营_seo推广有哪些方式_关于网络营销的方法

做一个医院网站多少钱_工业设计公司如何运营_seo推广有哪些方式_关于网络营销的方法

时间:2025/7/10 2:46:53来源:https://blog.csdn.net/pdw_jsp/article/details/145597462 浏览次数:1次
做一个医院网站多少钱_工业设计公司如何运营_seo推广有哪些方式_关于网络营销的方法

目标:我们要实现的是一个文本小猫 通过 tripo 生成模型并拥有跑动的动作(如下为生成后放入到unity的小猫动作)

在这里插入图片描述

主要分为如下步骤进行 官方网站

  1. 请求文生模型 task id(原始task id)
  2. 使用原始task id预校验rig
  3. 使用原始task id生成 rig task id
  4. 使用rig task id生成动画 animation task id
  5. 使用动画文件animation task id 查询动画文件是否生成并且返回下载动画文件地址
  6. 导入动画文件到unity工程中,并生成animator文件

1:请求文生模型 task id(原始task id)

保存如下代码成一个.sh 文件并执行请求原始文生模型任务

#!/bin/bash 
export APIKEY="tsk_***"
curl https://api.tripo3d.ai/v2/openapi/task \-H 'Content-Type: application/json' \-H "Authorization: Bearer ${APIKEY}" \-d '{"type": "text_to_model", "prompt": "a small cat"}'

返回

$ /c/Users/dongwei_peng/Desktop/tripo/requestTaskID.sh% Total    % Received % Xferd  Average Speed   Time    Time     Time  CurrentDload  Upload   Total   Spent    Left  Speed
100   118  100    68  100    50    160    117 --:--:-- --:--:-- --:--:--   277{"code":0,"data":{"task_id":"5b42ae63-0d62-4fa8-a218-dd8e0cafef22"}}

2:使用原始task id预校验rig

import requestsapi_key = "tsk_***"
url = "https://api.tripo3d.ai/v2/openapi/task"headers = {"Content-Type": "application/json","Authorization": f"Bearer {api_key}"
}data = {"type": "animate_prerigcheck","original_model_task_id": "5b42ae63-0d62-4fa8-a218-dd8e0cafef22"
}response = requests.post(url, headers=headers, json=data)print(response.json())

返回

{'code': 0, 'data': {'task_id': '99374ad3-bf18-4695-8e4d-f2facd417ea5'}}

3:使用原始task id生成 rig task id

import requestsapi_key = "tsk_***"
url = "https://api.tripo3d.ai/v2/openapi/task"headers = {"Content-Type": "application/json","Authorization": f"Bearer {api_key}"
}data = {"type": "animate_rig","original_model_task_id": "5b42ae63-0d62-4fa8-a218-dd8e0cafef22","out_format": "glb"
}response = requests.post(url, headers=headers, json=data)print(response.json())

返回

{'code': 0, 'data': {'task_id': '4417ee3e-016e-44bb-b343-684800c379f4'}}

4: 使用rig task id生成动画 animation task id

import requestsapi_key = "tsk_***"
url = "https://api.tripo3d.ai/v2/openapi/task"headers = {"Content-Type": "application/json","Authorization": f"Bearer {api_key}"
}data = {"type": "animate_retarget","original_model_task_id": "4417ee3e-016e-44bb-b343-684800c379f4","out_format": "glb","animation": "preset:run"
}response = requests.post(url, headers=headers, json=data)print(response.json())

返回

{'code': 0, 'data': {'task_id': '160f0598-61a4-41fb-8709-b73fb2edcc7f'}}

5:使用动画文件animation task id 查询动画文件是否生成并且返回下载动画文件地址

import requestsapi_key = "tsk_***"
task_id = "160f0598-61a4-41fb-8709-b73fb2edcc7f"
url = f"https://api.tripo3d.ai/v2/openapi/task/{task_id}"headers = {"Authorization": f"Bearer {api_key}"
}response = requests.get(url, headers=headers)print(response.json())

返回

{'code': 0, 'data': {'task_id': '160f0598-61a4-41fb-8709-b73fb2edcc7f', 'type': 'animate_retarget', 'status': 'success', 'input': {'original_model_id': '4417ee3e-016e-44bb-b343-684800c379f4', 'out_format': 'glb', 'animation': 'preset:run', 'spec': None}, 'output': {'model': 'https://tripo-data.cdn.bcebos.com/tcli_01c7f46f365f434b948c909f4ebcc0aa/20250212/160f0598-61a4-41fb-8709-b73fb2edcc7f/tripo_retarget_160f0598-61a4-41fb-8709-b73fb2edcc7f.glb?auth_key=1739404800-rmoVfenW-0-281dcf00a5950a088c7075bc7b6420fa'}, 'progress': 100, 'create_time': 1739352416, 'queuing_num': -1, 'running_left_time': -1, 'result': {'model': {'type': 'glb', 'url': 'https://tripo-data.cdn.bcebos.com/tcli_01c7f46f365f434b948c909f4ebcc0aa/20250212/160f0598-61a4-41fb-8709-b73fb2edcc7f/tripo_retarget_160f0598-61a4-41fb-8709-b73fb2edcc7f.glb?auth_key=1739404800-rmoVfenW-0-281dcf00a5950a088c7075bc7b6420fa'}}}}

6:导入动画文件到unity工程中,并生成animator文件 (略)

关键字:做一个医院网站多少钱_工业设计公司如何运营_seo推广有哪些方式_关于网络营销的方法

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: