HYP_STGR Posted September 4, 2017 Report Share Posted September 4, 2017 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 More sharing options...
Mattias Lagergren Posted September 5, 2017 Report Share Posted September 5, 2017 There seems to be something missing from this example; where does the "asset" come from? Link to comment Share on other sites More sharing options...
HYP_STGR Posted September 5, 2017 Author Report Share Posted September 5, 2017 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. Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted September 6, 2017 Report Share Posted September 6, 2017 I think that is most likely the issue. The asset in this case must be an "Asset" entity: asset = session.create('Asset', {'name': ...}) Link to comment Share on other sites More sharing options...
HYP_STGR Posted September 11, 2017 Author Report Share Posted September 11, 2017 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 More sharing options...
Mattias Lagergren Posted September 13, 2017 Report Share Posted September 13, 2017 Could you post a small script that reproduces the whole issue? As self-contained as possible Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.