Search the Community

Showing results for tags 'query'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Company news
    • General announcements
  • ftrack Studio (main app)
    • Open discussion
    • Feature requests
    • API
    • Help
    • Actions and Widgets
    • ftrack Go
  • Connect (plugins)
    • Open discussion
    • Feature requests
    • Help
  • Reviews
    • Open discussion
    • Feature requests
    • Help
  • Advisory Forum
  • Tech preview
    • New integrations
    • Studio overview
    • ftrack Review
  • Jobs board
    • Job listings

Categories

There are no results to display.


Found 12 results

  1. Query Latest Version

    Hi, You implemented in the version filter in the version view a "latest Version" checker box field, to be able to see just the latest versions. I'm missing this feature in the Widget settings of the Latest Version. Is there a way to query the latest version through the query field? Thanks. Best, Luigi
  2. Hi, We would like to be able to filter all latest versions of type "X" (e.g. a released playblast) that have a task "Y" (e.g. animation) and are linked to my current selection "Z" (e.g. a character in my asset library) We need to be able to query it though the browser UI of ftrack, without any line of code or a developer for it. e.g.: Show me the latest playblasts from the animation dept linked to my selected character The interface should filter the list accordingly. a simple query like: task.type.name="Animation" AND asset.parent.incoming_link.from = MY_SELECTION_LEFT or something like this: task.type.name is "Animation" AND task.parent.link.name is 'charactername' Would this be possible? If not, how long would it take that to implement this request? Best, Luigi
  3. Hi, I'm trying to figure out a query to retrieve all or selected custom_attributes in a query. I have some custom attributes on a project and my session has autopopulating turned OFF. project = session.query('select custom_attributes from Project where name is "{0}"'.format(name)).one() if I try to access my custom attribute "foo" the value of it is not set print project['custom_attributes']['foo'] > NOT_SET I tried to pass the attribute name directly to the query but that in key error project = session.query('select custom_attributes.foo from Project where name is "{0}"'.format(name, key)).one() > ServerError: Server reported error: KeyError(u"No attribute u'foo' exists for schema u'CustomAttributeValue'.") is it possible to fetch custom attributes in the main query?
  4. is query by link possible

    Hi, We are in the process of evaluating ftrack as a replacement for our in-house system. Quite often we need to find database entries based on a system path. From the system path, we can extract the project/sequence/shot etc names that are unique for an entity. One way to retrieve a shot information is with multiple queries to access specific IDs: project_number = 4444 sequence = 'Online' shot_name = 'sh010' project_id = session.query('select name, id from Project where name is {0}'.format(project_number)).first()['id'] sequence_id = session.query('select id from Sequence where name is {0} and project.id is {1}'.format(sequence,project_id)).first()['id'] shot = session.query('select name, link from Shot where name is {1} and parent.id is {0}'.format(sequence_id, shot_name)).first() this seems to be quite convoluted and potentially slow. however shot['link'] contains the same information of the parent structure that we can extract from the path and we could easily create it (without the IDs). is it possible to construct the 'link' with the names of the items in the hierarchy and use it to query? I tried something like this but the query doesn't like the square brackets (this is where my sql knowledge ends): [p['name'] for p in session.query('select name, link from Shot where name is sh010 and link[0].name is 4444 and link[1] is online')] is there another better way to query a shot (or another entity) knowing its logical path (link)? thank you Pawel
  5. Query join

    Hi, Is it possible to send queries with the new API that will use joins on several objects. I would like to query an asset for a specific asset build, i.e. something like this: Asset where parent.id is ( select id from AssetBuild where project.id is <projectId> and name is "<myAssetBuildName>")Is this kind of request valid with the new API ?
  6. Query ' where ... is ...' not case sensitive

    Hi all, I have 2 assets in Ftrack: 'asset_name' and 'ASSET_NAME'. When I query via the API both assets, all the time I get only the first one because the name is not case sensitive. Example: assets = session.query("Asset where name is 'asset_name'").all() print len(assets) print assets[0]['name'] print assets[0]['id'] # Return: 1 asset_name 4c63aa70-6475-11e6-b6fd-005056a76761 assets = session.query("Asset where name is 'ASSET_NAME'").all() print len(assets) print assets[0]['name'] print assets[0]['id'] # Return: 1 asset_name 4c63aa70-6475-11e6-b6fd-005056a76761 Ftrack server: v3.3.30 API: v0.15.5
  7. In our Ftrack installation, we have defined a custom attribute at the project level--let's call it "locations". I would like to create a function that allows users to add an additional location to a project after querying that the provided argument is indeed an available option in the collection of locations. I can't find an example of this kind of query; I just need to know whether this is something attached to Session or somewhere else. So let's say locations = {'Uptown': 'uptown', 'Downtown': 'downtown', 'Midtown': 'midtown'} (in settings it's an Enumerator that seems to be represented as a dictionary) We created our own wrappers for some of several of the Ftrack queries, so I decided not to include that code. The part in bold is what I'm getting at... is this the way to access it? I thought this might be the way because the documentation says: "The custom attributes available on entities are cached on the Session." It isn't working when I run unit tests.
  8. So I'm trying to create a tool that creates tasks from Maya. I got the initial prototype working, but I'm having trouble with optimization. Originally, when the user hit the create task button, the session would query the schema, get the available task types, and then put them into a combobox. This worked fine, but the long loading time proved to be too slow for production. So I figured what if I loaded the task types when the user first ran the tool? That way when they went to create a task, the combobox would be filled and ready to go. This worked at first, but along the way things started to fall apart as I added more automation to the code. Maya started to hang at random times and eventually started to consistently hang during every startup. I ended up removing the code that builds the combobox data cache and that fixed the issue (so that code is the problem). The data is being added in a way so the task type name is displayed, but the task type id data is returned on selection. Here's what I have so far, the problem area is the for loop: # Ftrack session data to get shot name for tab widget shot_id = os.getenv('FTRACK_SHOTID') shot = session.get('Shot', shot_id) self.shot_name = shot['name'] project = shot['project'] schema = project['project_schema'] self.cb_task_types = QtGui.QComboBox() self.task_types = schema.get_types('Task') for task_type in self.task_types: self.cb_task_types.addItem(task_type['name'], task_type['id'])
  9. New API: Query entity type

    I'm trying to figure out how to query what an item is based on user selection. In my tool, a user might be selecting a Sequence, Task, Shot, etc and I'd like different things to happen based on their selection. Is there any way to query this with the new API? The docs seem to just show how to query something only if you know exactly what entity type you want. I have this right now: dir_contents = [] for item in project['children']: dir_contents.append( item ) for item in dir_contents: item_name = item['name'] item_type = item['context_type'] item_id = item['id'] When I tested this code out by selecting a Sequence entity, I printed out every attribute and expected to find 'sequence' as a value somewhere, but only the attribute, context_type, resulted in something close to what I was looking for ( print item['context_type'] resulted in 'task' as a value ) Thanks for any help!
  10. 1) I'm having trouble getting the criteria system to work. When the tool starts up, in the main window module queries all of the active projects and populates a QTreeView: session = ftrack_api.Session() dir_contents = [] for project in session.query('Project'): dir_contents.append( project ) When a user selects a project to work with, another module creates a tab and queries the project data- populating this new tab with directory hierarchy, tasks, thumbnails, notes, etc. I was able to begin querying a project's ftrack data by using the legacy method getProject('string'), but I'm having trouble getting the equivalent to work using the latest API. This is what I have right now: selected_index = self.tab_projects.tv_projects_view.selectedIndexes()[0] session = ftrack_api.Session() project = session.query( 'Project where name is "{0}"' .format(selected_index.data()) ) The value for selected_index.data() is just a string like 'MY_PROJECT_NAME'. I keep getting this error: QueryResult.__getitem__ in query line 89: list indices must be integers, not str. 2) Also, if I'm querying, should I be setting a session variable in every module that queries, or should I be doing this globally somewhere? Thanks! ----------------EDIT------------- 3) So I figured out from here that I needed to add .one() at the end of the query like this. I guess it's a python method to only return 1 value. Why wouldn't this query return just 1 value by default though? project = self.session.query( 'Project where name is {0}' .format(selected_index.data()) ).one()
  11. Query operator

    Hi, Is there a simple way to query for the last version of an asset with the new API ? And more generally is there a plan to add new selection operator like: max, avg, sum or count ? Cheers, Jerome
  12. I want to get list of task that was changed in status or published during some period of time. There should be a function with input - start_date,end_date and output - List of Tasks