Skip to content

Instantly share code, notes, and snippets.

@boredstiff
Created August 1, 2017 15:07
Show Gist options
  • Save boredstiff/7b8e338f645a8acb734dbf3e71295751 to your computer and use it in GitHub Desktop.
Save boredstiff/7b8e338f645a8acb734dbf3e71295751 to your computer and use it in GitHub Desktop.
Shotgun Task Query
query = {
'entity_type': 'Task',
'filters': [
['project', 'is', {'type': 'Project', 'id': project_id}],
{'filter_operator': 'any',
'filters': [
# Ensure that the task is on a shot, we're not setting
# the sequence on the tasks in Shotgun.
['entity.Shot.id', 'is_not', None],
# Or that the task is on an asset.
['entity.Asset.id', 'is_not', None]
]},
],
'fields': [
'content',
'sg_task_type',
'sg_task_part_name',
'entity.Shot.id',
'entity.Shot.code',
'entity.Shot.sg_short_code',
'entity.Shot.sg_sequence.Sequence.id',
'entity.Shot.sg_sequence.Sequence.code',
'entity.Asset.id',
'entity.Asset.code',
'entity.Asset.sg_asset_type',
'entity.Asset.sg_asset_name']
}
tasks = shotgun_().find(**query)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment