Vlad Skrypnyk Posted March 22, 2023 Report Posted March 22, 2023 Hi I want to get some shot by his name from the project in one query, how I need to combine criteria proj = session.query('Shot where name is "{0}" and Project where name is "{1}"'.format('sh01', 'dev'))
alexisp Posted March 23, 2023 Report Posted March 23, 2023 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"')
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now