在展示栏右键加号 点击configure Columns
# -*- coding: utf-8 -*-
# .@FileName:find_shotgun_shot
# @Date....:2019-12-04 17:07
# ..:XingLian
# rv sg
sys.path.append(r'C:\Program Files\Shotgun\RV-7.5.1')
sys.path.append(r'W:\api\python-api-sg')
import shotgun_api3
# 登录sg
sg = shotgun_api3.Shotgun("https://dezerlin.shotgunstudio.com",
login="ying_buxi",
password="Ying+1314-")
# 查找任务
def creat_shot_new_version(shot_name, task_name, ple_step, project_name):
filters = [['name', 'is', project_name]]
Project = sg.find_one('Project', filters)
filters = [['project', 'is', Project],
['code', 'is', shot_name]]
shot = sg.find_one('Shot', filters)
if ple_step not in ["other"]:
task = sg.find("Task", [['project', 'is', Project], ["content", "is", task_name], ["step", 'name_is', ple_step],['entity', 'is', shot]],["sg_status_list"])
else:
task = sg.find("Task", [['project', 'is', Project], ["content", "is", task_name],
['entity', 'is', shot]], ["sg_status_list"])
return task
shot_name = 'g10150'
task_name = 'anm'
ple_step = 'animation'
project_name = 'WTS'
task = creat_shot_new_version(shot_name, task_name, ple_step, project_name)
filters = [['sg_task.Task.step.Step.code', 'is', 'animation'],
["sg_task", "is", task]]
fields = ["code"]
print('x')
print(sg.find_one("Version", filters, fields))