后台转化

使用脚本在后台制作 Nemo Rig 的参考代码

您可以直接调用 nemo.pipeline.convert 中的 process 函数将maya文件转化为nemo rig,也可以使用nemo.m2n和nemo.n2m模块,结合以下的提交nemofarm示例完成处理。

import requests
import time
import shutil
import re

url = "https://www.nemopuppet.com/api"

message = {
    'username': '',
    'password': '',
}

recv = requests.post(url+'/login', data=message)
auth = recv.cookies

files = {'file': open('__GRAPH.json','rb')}
message = {'platform': 'Windows', 'gpu': True}
recv = requests.post(url+'/tasks', data=message, files=files, cookies=auth)
task_id = recv.json()['id']

while True:
    recv = requests.get('{}/task/{}'.format(url, task_id), cookies=auth)
    task_status = recv.json()['status']
    print(task_status)
    if task_status in {'Waiting', 'Running'}:
        time.sleep(5)
    else:
        break

if task_status == 'Success':
    recv = requests.get(url+'/artifact/{}'.format(task_id), stream=True, cookies=auth)
    filename = re.findall('filename=\"(.+)\"', recv.headers['content-disposition'])[0]

    with open('<BinaryZipFolder>/{}'.format(filename), 'wb') as f:
        shutil.copyfileobj(recv.raw, f)

最后更新于