Rory Posted September 6, 2017 Report Share Posted September 6, 2017 Hi All, First post - and very new to the api. I am trying to return the path of an image sequence in a component added by processor from Nuke Studio. How do I return the 'plain text' result of this ? component = session.query( 'Project name is "dev_project"' and 'Shot where name is "010"' and 'Assetversion name is "BG v2"' and 'Component where name is "Ingest"' ).all() print component[0]['component_locations'] Sorry if this is straight forward - still trying to get to grips with the querying. Thanks so much, Rory Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted September 7, 2017 Report Share Posted September 7, 2017 Hi Rory, I'm not able to try my own code at the moment but something like this: component = session.query( 'Component where ' 'name is "Ingest" and ' 'version.asset.parent.project.name is "dev_project" and ' 'version.asset.parent.name is "010" and ' 'version.version is 2 and ' 'version.asset.name is "BG v2"' ).first() location = session.pick_location(component) path = location.get_filesystem_path(component) Link to comment Share on other sites More sharing options...
Rory Posted September 7, 2017 Author Report Share Posted September 7, 2017 Hi Mattias, That returns 'None' but I can get component to return : <SequenceComponent(4f475f4f-a2b4-4eeb-b391-ed2ad0780b5f)> but then location returns 'None' : Traceback (most recent call last): File "ftrack_query.py", line 61, in <module> path = location.get_filesystem_path(component) AttributeError: 'NoneType' object has no attribute 'get_filesystem_path' Thanks, Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted September 8, 2017 Report Share Posted September 8, 2017 Do you know what locations the component is in? If not you can check it like this: for component_location in component['component_locations']: print component_location['location']['name'] Link to comment Share on other sites More sharing options...
Rory Posted September 8, 2017 Author Report Share Posted September 8, 2017 Yes, that returns: studio.central-storage-location Link to comment Share on other sites More sharing options...
Rory Posted September 8, 2017 Author Report Share Posted September 8, 2017 This works .... for component_location in component['component_locations']: print component_location['location'].get_filesystem_path(component) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.