Sending a .mov to Web review
1 1

6 posts in this topic

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/"
    component = version.create_component(path= filepath ,data={'name': ''}, location= server_location)

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


 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:

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



Share this post

Link to post
Share on other sites

Oh yeah "asset" is actually shot. My function actually receive the shot from outside but to simplify the OP sample i put it inside the function and forgot to change the name. I'm going to edit the OP.

Share this post

Link to post
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 is \""  + "EP101_SHOT0010" + "\"").first()
sendVideo(newAsset,task) #same function as in OP.

Any idea of what is missing? thanks!


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
1 1