sg web api


登录sg

def get_version(shot_name, step_name, ):
    sg = shotgun_api3.Shotgun("https://xinglian.shotgunstudio.com",
                              login="user",
                              password="password")
    Project = sg.find('Project', [['name', 'is', 'WTS']])
    shot = sg.find('Shot', [['project', 'is', Project], ['code', 'is', shot_name]])
    step = sg.find('Step', [['id', 'is', 8]], ['code'])
    task = sg.find('Task', [['step.', 'is', step], ['entity', 'is', shot], ['content', 'is', 'cmp']])

    version = sg.find("Version", [['project', 'is', Project], ['entity', 'is', shot], ['sg_task', 'is', task]], ['code'])
    if version:
        return sorted([j['code'] for j in version])[-1]
    else:
        return


for i in shots:
    print(get_version(i))
    
    
# shotgun上传视频  sg.upload('Version', version_id, path)

# shotgun上传缩略图  sg.upload_thumbnail('Version', version_id, path)

# 更新字段 sg.update('实体类型', id, {data_dic})

评论
  目录