0

get sg_latest_version and sg_latest_version_path_frames

hey there,

i am very new into dealing with shotgun via python, so please forgive me the newbie question.

for now my basic code works kind of alright, but soon as i want to get values for the latest version and the path frames for that i received 'None' as a value.

i would love to use fields to gather  a list of important version like, latest version, latest sent to client, etc.

 

any help on this?

 

thanks,

falk

댓글 2개

  • 0
    Avatar
    Veselin Gyurov

    Hi,
    here is smth that I came up with which I think its ok for start :>.

    #project id
    proj_id=80

    # get tasks in project with the id
    filters=[["project","is",{"type":"Project","id":proj_id}]]
    get_tasks=sg.find("Task",filters,["updated_at","content"])

    #loop through tasks and get all with status "snt" and then arange them
    for each_task in get_tasks:
    filter_vers=[["sg_task","is",{'type':'Task', 'id':each_task["id"]}],["sg_status_list","is","snt"]]
    get_ver=sg.find("Version",filter_vers,["sg_status_list","code"],order=[{"column":"updated_at","direction":"desc"}])
    try:
    #print latest with status "snt"
    print get_ver[0]["code"]
    except:
    pass

    this should give you latest version with status "snt" from the project.

    Hope this helps.

  • 0
    Avatar
    Veselin Gyurov

    Ups its not tabulated properly sry T_T.

댓글을 남기려면 로그인하세요.