I am trying to create code that publishes may work to shotgun and puts it into the correct place i got everything going except the file upload so it can create a publish with everything in That i want but it dosent want two do the upload it keeps on failing
So it is workin like this
nameofupload = ‘100_010_anim_v1’
comment = 'Plase or create interface for this2'
path = 'C:\Users\test\Desktop\REf\HTB1Cb.TSpXXXXazapXXq6xXFXXXT.jpg'
data = { 'project': {'type': 'Project','id': 92},
'code': nameofupload,
'description': comment,
'sg_path_to_frames': path,
'sg_status_list': 'rev',
'entity': {'type': 'Asset', 'id': 1439},
'sg_task': {'type': 'Task', 'id': 5822},
'user': {'type': 'HumanUser', 'id': 88} }
result = shotgun.create("Version", data)
But if i add the lines that should add the file acording two what i understand it gives error here is code i used to make the file upload :
nameofupload = '100_010_anim_v1'
comment = 'Plase or create interface for this2'
path = 'C:\Users\test\Desktop\REf\HTB1Cb.TSpXXXXazapXXq6xXFXXXT.jpg'
uploadpath = {'link_type': 'upload', 'local_path': path, 'url' : path}
uploadpath = {'path': 'C:\\Users\\test\\Desktop\\REf', 'folder': 'C:\\Users\\test\\Desktop\\REf', 'extension': 'jpg', 'filename': 'BU-5b-013_9947.jpg'}
data = { 'project': {'type': 'Project','id': 92},
'code': nameofupload,
'description': comment,
'this_file': uploadpath,
'sg_path_to_frames': path,
'sg_status_list': 'rev',
'entity': {'type': 'Asset', 'id': 1439},
'sg_task': {'type': 'Task', 'id': 5822},
'user': {'type': 'HumanUser', 'id': 88} }
result = shotgun.create("Version", data)
Eni Help with this will be apreciated please even just telling me what i am doing wrong or something please