Jump to content

Sending a .mov to Web review


HYP_STGR

Recommended Posts

Hi! I'm trying to send a  .mov video of a shot to ftrack using the python api but i'm having some problems

my code:

def sendVideo(asset,task):
	
    version = session.create('AssetVersion', {'asset': asset,'task': task})

    server_location = session.query('Location where name is "ftrack.server"').one()
    filepath = "my/path/to/videos/101_010.mov"
    
    component = version.create_component(path= filepath ,data={'name': '101_010.mov'}, location= server_location)

shot = session.query("Shot where name is \"EP101_SHOT0010\"").first()
task = session.query("Task where parent.name is \"EP101_SHOT0010\"").first()

sendVideo(shot,task)

 but when i try to run this code i get this error at the last line:

 

ftrack_api.exception.LocationError: Failed to register components with location <ServerLocation("ftrack.server", 3a372bde-05bc-11e4-8908-20c9d081909b)> due to error:
    Server reported error: KeyError('versions')
    Transferred component data that may require cleanup: [(<dynamic ftrack FileComponent object 2158043712>, '29715fa3-488c-46d2-9d3d-677711776c7d')]

I'm following this tutorial here:

http://ftrack-python-api.rtd.ftrack.com/en/stable/example/web_review.html

Do you guys have an idea of what can it be?

Thanks.

Ottoni.

Link to comment
Share on other sites

On 06/09/2017 at 4:23 AM, Mattias Lagergren said:

I think that is most likely the issue. The asset in this case must be an "Asset" entity:


asset = session.create('Asset', {'name': ...})

 

I tried to create an Asset,make the shot be the parent of it and send the asset to that function but the same error is happening. Here is the code:

 

shot = session.query("Shot where name is \""  + "EP101_SHOT0010" + "\"").first()
newAsset = session.create("Asset",{'name': "101_010",'type': "Shot",'parent': shot})
task = session.query("Task where parent.name is \""  + "EP101_SHOT0010" + "\"").first()
sendVideo(newAsset,task) #same function as in OP.

Any idea of what is missing? thanks!

Ottoni.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...