Jump to content

Get shot in the project by name at one query


Vlad Skrypnyk

Recommended Posts

  • Vlad Skrypnyk changed the title to Get shot in the project by name at one query

Hi, when typing "Project where" you are using the syntax to go look for projects of the "Project" table.

What you actually want to filter is the "project" attribute of the Shots:

my_shot = session.query('Shot where name is "my_shot" and project.name is "the_project"').first()

# while we are at it the "like" syntax can be useful here to get all shots that starts with a given prefix
# (but you should probably use a proper Folder/Sequence to organise your shots)

# for exemple let's say shots from the SequenceA of my project are prefixed with "sqa"
sqa_shots = session.query('Shot where name like "sqa%" and project.name is "the_project"')

 

Link to comment
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
×
×
  • Create New...