Jump to content

Component Path


Rory

Recommended Posts

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

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

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

Archived

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

×
×
  • Create New...